Other Resources:
Start of string anchor ^
What is the "start of string" anchor in a regular expression? How to use it?
How to write a regular expression using "start of string" anchor to validate discover credit card numbers like: 6011963280099774?
✍: FYIcenter.com
![]()
The "start of string" anchor is an atomic zero-width assertion specifing that the match must occur at the beginning of the string. The "start of string" anchor is represented as '^'. For example:
^5\d* # matches MasterCard numbers starting with '5'
The regular expression to validate Discover credit card numbers:
^6011\d{12}
^ - matches 'start of string'
\d{12} - repeats \d 12 times
2013-01-26, 0👍, 0💬
Popular Posts:
All credit card numbers issued by American Express must start with 34 or 37 and have 15 digits. For ...
All credit card numbers issued by Diners Club must start with 300 through 305, 36 or 38 and have 14 ...
How to write a regular expression to validate GUID (Globally Unique IDentifier) or UUID (Universally...
How to capture the Sogou web spider entries from Web log file? Here are some Web log file entries: 1...
How to capture the Sogou web spider entries from Web log file? Here are some Web log file entries: 1...