Other Resources:
Comments in regular expression (?#...)
Is there any way to enter a comment into regular expressions?
How to write a regular expression with comments to match date strings in yyyy-mm-dd format like: 2013-01-26
✍: FYIcenter.com
Yes. Comments can be entered in regular expressions using (?#...) format. For example:
"(?:[^"\]++(?#no-backtracking)|\.)*+(?#no-backtracking)"
The regular expression with comments to validate data strings:
(?#year)\d{4}-(?#month)\d{2}-(?#day)\d{2}
(?#year) - comment
\d{4} - 4 digits for year
(?#month) - comment
\d{2} - 2 digits for month
(?#day) - comment
\d{2} - 2 digits for day
2013-01-26, 0👍, 0💬
Popular Posts:
According to the IEEE 802 specification, a MAC address has 6 groups of 2 hexadecimal digits separate...
How to write a regular expression to validate GUID (Globally Unique IDentifier) or UUID (Universally...
All credit card numbers issued by JCB have 3 sets of numbers: JCB cards start with 2131 have 15 digi...
Are you having problems using regular expressions when processing text strings in your applications ...
All credit card numbers issued by American Express must start with 34 or 37 and have 15 digits. For ...