JavaScript, what does the regular expression / (a) \ 1 + /?
https://regex101.com/r/dS8mZ0/1
As I understand it, this expression is similar to / (a) {2,} /, but the description of such (/ (a) \ 1 + /) syntax cannot be found.
JavaScript, what does the regular expression / (a) \ 1 + /?
https://regex101.com/r/dS8mZ0/1
As I understand it, this expression is similar to / (a) {2,} /, but the description of such (/ (a) \ 1 + /) syntax cannot be found.
(a) - a group of a\1 - the requirement to repeat the match with the first group\1+ - the requirement to repeat the match with the first group one or more times.
Yes, in this case, the expression is equivalent to: (a){2,}
But in this - no longer: ([ab])\1+ - it is equivalent to essentially a{2,}|b{2,} , although getting the same first group in the last version will not work.
For more complex constructions, the equivalent expression will be much more difficult or even impossible to construct.
Source: https://ru.stackoverflow.com/questions/420208/
All Articles