regulex icon indicating copy to clipboard operation
regulex copied to clipboard

Why this regular is not recognized?

Open ccl20210529 opened this issue 3 years ago • 3 comments

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

ccl20210529 avatar May 29 '21 02:05 ccl20210529

(?<=\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

wzhck avatar Jun 08 '21 13:06 wzhck

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

alexetgus avatar Jun 10 '21 21:06 alexetgus

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

liudongmiao avatar Jun 28 '22 10:06 liudongmiao