Other Resources:
None capturing group (?:...)
Is there any to stop capturing a group to improve matching performance?
How to write a possessive quantified subpattern to match double-quoted strings like this: "He said: \“Hello!\â€"?
✍: FYIcenter.com
Yes. To turn the default capturing behavior on a group, you can entered '?:' at the beginning of the group as (?#:...). For example:
qua(1|nt)ifier # matches both 'qualifier' and 'quantifier' qua(?:1|nt)ifier # matches both words, but no capturing
The regular expression to match double-quoted strings efficiently is:
"(?:[^"\]++|\.)*+"
(?:...) - non-capture grouping
[^"\]++ - repeat [^"\] 1 or more times without backtracking
\. - any character escaped by \
(...)*+ - repeat (...) 0 or more times without backtracking
2013-01-26, 0👍, 0💬
Popular Posts:
All credit card numbers issued by JCB have 3 sets of numbers: JCB cards start with 2131 have 15 digi...
All credit card numbers issued by JCB have 3 sets of numbers: JCB cards start with 2131 have 15 digi...
All credit card numbers issued by American Express must start with 34 or 37 and have 15 digits. For ...
How to capture the Baidu spider entries from Web log file? Here are some Web log file entries: 127.0...
According to the IEEE 802 specification, a MAC address has 6 groups of 2 hexadecimal digits separate...