Syntax error Is their a negative lookbehind equivalent in JavaScript?

Is their a negative lookbehind equivalent in JavaScript?



For a negative look-behind in JavaScript, use the following −

(^|[^\])"

To replace double quotes, you can use the following −

str.replace(/(^|[^\])"/g, "$1'")
Updated on: 2020-06-24T06:45:12+05:30

96 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements