Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Can someone help me to fix this regex to use in javascript?
(?<!\\\\)#\\{{1,2}
Regex tester said:
SyntaxError: Invalid regular expression: /(?:((?<!\\)#\{{1,2})|(.))/: Invalid group
Thanks.
'#embedded-ruby': [ { token: 'punctuation.section.embedded.ruby', regex: '(?<!\\\\)#\\{{1,2}'
(?<!\\)
(?:^|[^\\])
maybe /(?:((?!\\)#\{{1,2})|(.))/. in python negative lookback is (?<!...) but in javascript is (?!...) just remove <
/(?:((?!\\)#\{{1,2})|(.))/
negative lookback
(?<!...)
(?!...)
<
Add a comment
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
'#embedded-ruby': [ { token: 'punctuation.section.embedded.ruby', regex: '(?<!\\\\)#\\{{1,2}'(?<!\\)with(?:^|[^\\])