regex - Replacing '(' with '( ' if it's not inside quotes -


let's have text this:

(what) 

and

"(what)" 

i'm trying replace ( ([space] if it's not inside quotes.
after substitution first string should this:

( what) 

and second string shouldn't changed.

i tried [^"]\([^"] didn't work.

you can using lookarounds.

you can use regex:

^(?!").*(\() 

working demo

btw, can use discard technique:

.*?".*?".*?|(\() 

working demo


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -