SyntaxError: Invalid regular expression: invalid group specifier name
Regular problem
Safari
SyntaxError: Invalid regular expression: invalid group specification name
Firefox
SyntaxError: invalid regexp group
Mobile terminal: Android is normal, iOS is not
reason
Firefox, IE, and IOS do not support the following writing methods: ?<=, ?<!, ?!, ?=
Look ahead is a kind of conditional judgment, such as if statement
(?=exp) the position that satisfies expression exp after positive look ahead match
(?!exp) the position that does not satisfy expression exp after negative look ahead match
Solution:
let reg = /ab?<=cd/
Modify to
let reg = new RegExp('ab(?<=cd)')
Read More:
- Firefox: How to Solve Syntax error: invalid regexp group
- Error:invalid new-expression of abstract class type XXX [How to Solve]
- [Solved] Python2 Install tensorflow Error: class DescriptorBase(metaclass=DescriptorMetaclass), SyntaxError: invalid syntax
- [Solved] Appium Error: InvalidArgumentException: Message: invalid argument: invalid locator
- Log4j2 reports ERROR StatusLogger Unrecognized format specifier
- [Solved] Notwritablepropertyexception: invalid property ‘mapperhelper’ of bean class
- [Solved] Android Compile and Package Error: Invalid keystore format
- git error:invalid path [How to Solve]
- Stata Comment // Error / invalid name r(198); [How to Solve]
- [Solved] mybatis plus Error: Invalid bound statement (not found)
- latex Package inputenc Error: Invalid UTF-8 byte “A1
- [How to Solve] Error: Invalid or corrupt jarfile…
- [Solved] error “invalid command name “tcl_findLibrary““
- [Solved] Android Studio Compile Error: Invalid main APK outputs : EarlySyncBuildOutput
- insmod Error: Invalid module format [How to Solve]
- [Solved] HALCON error #5190: Invalid window parameter
- CIBERSOFT $operator is invalid for atomic vectors [How to Solve]
- [Solved] RuntimeError: CUDA error: invalid device ordinal
- Seaborn Color ValueError: Invalid RGBA argument: [‘#f9802d‘, ‘#f26b15‘, ‘#fdc48f‘]
- Mybatis error under Springboot project: Invalid bound statement (not found)