Regex for Bank Account Number and Bank Routing Number - regex

Does anyone know which is the format for these two criteria?
Bank Account Number
Bank Routing Number
I am interested in what format regex for two.
I look forward to a response from you
Thanks in advance!

Routing numbers (at least in the US) are always 9 digits. See routing numbers on Wikipedia for a thorough breakdown of how the routing number is structured and what values are acceptable. (Note: Regex is almost certainly not what you want to use to validate these.)
Account numbers are of arbitrary length and value, as defined by the individual bank. It cannot be validated without checking with the bank in question.
All this, and more, was asked and answered in this SO question.

Related

Regex pattern for minimum currency

I need a regex pattern for minimum currency, in this instance, so a number under $1000.00 cannot be input into the field. only $1000.00 and up to say $9999.00. This is for a DocuSign Template.
Number 1., The one-time transfer amount from the screenshot must be 1000.00 or higher.
Number 2., The monthly selection must be $100.00 or more.
Here is what I currently have to make them input it in Monetary form. I am struggling with adding the currency thresholds/minimums described above.
^[+-]?[0-9]{1,3}(?:,?[0-9]{3})*\.[0-9]{2}$
I am a novice at best so thank you for any help in advance.
I'm thinking you want something along these lines for 100.00 to 9999.99 you would want a different regex per field.
^[1-9]\d{2,3}\.\d{2}$
https://regex101.com/r/K2SnS7/1
Check that out and play with it. You just need to think in a regex manner, what are the values I can have first, probably not zero. So 1 to 9, with between two and three more numbers. Followed by a decimal and any two numbers. Good luck!

Validate Street Address Format

I'm trying to validate the format of a street address in Google Forms using regex. I won't be able to confirm it's a real address, but I would like to at least validate that the string is:
[numbers(max 6 digits)] [word(minimum one to max 8 words with
spaces in between and numbers and # allowed)], [words(minimum one to max four words, only letters)], [2
capital letters] [5 digit number]
I want the spaces and commas I left in between the brackets to be required, exactly where I put them in the above example. This would validate
123 test st, test city, TT 12345
That's obviously not a real address, but at least it requires the entry of the correct format. The data is coming from people answering a question on a form, so it will always be just an address, no names. Plus they're all address is one area South Florida, where pretty much all addresses will match this format. The problem I'm having is people not entering a city, or commas, so I want to give them an error if they don't. So far, I've found this
^([0-9a-zA-Z]+)(,\s*[0-9a-zA-Z]+)*$
But that doesn't allow for multiple words between the commas, or the capital letters and numbers for zip. Any help would save me a lot of headaches, and I would greatly appreciate it.
There really is a lot to consider when dealing with a street address--more than you can meaningfully deal with using a regular expression. Besides, if a human being is at a keyboard, there's always a high likelihood of typing mistakes, and there just isn't a regex that can account for all possible human errors.
Also, depending on what you intend to do with the address once you receive it, there's all sorts of helpful information you might need that you wouldn't get just from splitting the rough address components with a regex.
As a software developer at SmartyStreets (disclosure), I've learned that regular expressions really are the wrong tool for this job because addresses aren't as 'regular' (standardized) as you might think. There are more rigorous validation tools available, even plugins you can install on your web form to validate the address as it is typed, and which return a wealth of of useful metadata and information.
Try Regex:
\d{1,6}\s(?:[A-Za-z0-9#]+\s){0,7}(?:[A-Za-z0-9#]+,)\s*(?:[A-Za-z]+\s){0,3}(?:[A-Za-z]+,)\s*[A-Z]{2}\s*\d{5}
See Demo
Accepts Apt# also:
(^[0-9]{1,5}\s)([A-Za-z]{1,}(\#\s|\s\#|\s\#\s|\s)){1,5}([A-Za-z]{1,}\,|[0-9]{1,}\,)(\s[a-zA-Z]{1,}\,|[a-zA-Z]{1,}\,)(\s[a-zA-Z]{2}\s|[a-zA-Z]{2}\s)([0-9]{5})

RegExp for Indian Bank Account Number

I need to write a regular expression to check for valid bank account number format of major banks in India. Does anyone know what regular expression check should be? Perhaps I just check to make sure all characters are digits?
RBI dictates certain rules like you've mentioned over Indian Bank Account Number structures (9 - 18).
Most of the banks have unique account numbers.
Account number length varies from 9 digits to 18 digits.
Most of the banks (67 out of 78) have included branch code as part of the account number structure. Some banks have product code as part of the account number structure.
40 out of 78 banks do not have check digit as part of the account number structure.
All banks have purely numeric account numbers, except one or two foreign banks.
Only in the case of 20 banks, account numbers are formed without any pattern with a unique running serial number.
Indian Bank Account Number Validation Regex:
^\d{9,18}$
A better way to validate would be to select the right bank and then have checks in place as per the bank which have been outlined and analyzed by the RBI here.
According to RBI Reserve Bank of India
-> The bank should have 9-18 digits
"[0-9]{9,18}"

Excluding % from a Regex number search

I'm attempting to create a Regex that finds only 2-digit integers or numbers with a precision of 2 decimal points.
In the example string at the bottom, I want to find only the following:
21 and 10.50
Using this expression, 100% is getting captured, in addition to the strings I desire to capture:
(\d){1,2}(\.?)([0-9]?[0-9]?){1,2}
I know I need to use ^% somewhere, but I can't figure out where it goes. Any suggestions are greatly appreciated.
Here's my sample string:
Earn Up to $21 Per Hour - Deliver Food with !!
Delivery Drivers work when they want and make great money when they do.
All orders are prepaid, just pick them up and deliver them to hungry diners. No waiting in line or fumbling with receipts and prepaid cards.
It's fast and easy to start working. Get started today.
Apply Now
Why choose ?
More orders than any other takeout platform
100% of our restaurants are official partners
Competitive pay: Per order fee + mileage + tips
We guarantee an hourly minimum of $10.50/hour*
Create your own schedule & work the hours you want
Word boundaries in your regular expression will grant you a bit more control.
Since word boundaries are a bit strict, we need to introduce an OR condition to address both cases which will satisfy your regex.
(\b[\d]{2}\.[\d]{2}\b)|(\b[\d]{2}\b)
Edit: Try this one,
\b[\d]{2}\b(\.[\d]{2})?
The first example has a chance to fail as it is order dependent due to the way it short-circuits. This I believe should address multiple cases properly.
I think this should work:
(?<!\d)((\d+\.\d\d)|(\d\d))(?!%|\d)
Demo (and explanation)
EDIT:
Improved version:
(?<!\d)(\d{1,2}(?:\.\d{1,2})?)(?!%|\d)
Demo (and explanation)
You can try this variant: (\d{1,}|[\d.])\b(?!%)
It uses negative lookahead (?!%) to exclude digits following by % sign.
Details at regex101

Regular expression for all bank card numbers

I am using a regular expression to match all UK bank card number formats; I have done research and managed to find/amend a regex that covers the majority of formats. However, I have a bit of an edge case where one is not matching and I do not know why, or how to resolve. This is what I am using:
(\b[4|5|6](\d){3}[\s|-]?((\d){4}[\s|-]?){2}(\d){4}\b)|(\b(\d){4}[\s|-]?(\d){6}[\s|-]?(\d){5}\b)
This is an example card number that does not work: 6759000000005
This is an example card number that does work: 675900000000555
Apologies if this is an easy question, I am fairly new to regular expression syntax. Any help to resolve would be greatly appreciated. Thanks.
See here the demo
The regex is (\b[4|5|6]\d{3}[\s-]?(\d{4}[\s-]?){2}\d{1,4}\b)|(\b\d{4}[\s-]?\d{6}[\s-]?\d{5}\b)
I'm not an expert of UK cards, so I can't tell what is the expected format as you did not gave exemples with spaces or hyphens in them...
If you can refine the requirements it's handlable.
A more generic card number validation (without separators, so you'll need to strip them before) would be
\d{6}\d{1,12}\d
As per the requirements of the norm (found nothing on the minimum length of the account identifier):
An ISO/IEC 7812 card number is most commonly 16 digits in length,[1]
and can be up to 19 digits. The structure is as follows:
a six-digit Issuer Identification Number (IIN) (previously called the
"Bank Identification Number" (BIN)) the first digit of which is the
Major Industry Identifier (MII), a variable length (up to 12 digits)
individual account identifier, a single check digit calculated using
the Luhn algorithm.[2]