CJex / regulex

:construction: Regular Expression Excited!
https://jex.im/regulex/
MIT License
5.71k stars 756 forks source link

Why this regular is not recognized? #54

Open ccl20210529 opened 3 years ago

ccl20210529 commented 3 years ago

(?<=\d{6})\d{10}(?=.{2})

wzhck commented 3 years ago

(?<=\d{6}) is a lookbehind ((?<=) or (?<!)), which is NOT supported by JavaScript. In fact JavaScript can support your lookahead(?=.{2})((?=) or (?!)).

You can use (?=\d{6})\d{10}(?=.{2}) instead (ref: javascript-regex-look-behind-alternative):

image

alexetgus commented 3 years ago

The Javascript used is very minimalist. It does not dwell on the particularities of PCRE Regex...

liudongmiao commented 2 years ago

demo: https://jianyu.io/regulex/