Regex match jQuery selectors

I’m doing some search and replace work to batch update some files and I need to replace this:

$(‘#navbar > ul ul’)

where the selector part navbar > ul ul can be any selector, restricted by that its only made up of lowercase letters and > . # signs.

I’m doing seacrh and replace with notepad++ and from examples I think my regex for finding the first string should look something like this:


Im not sure if all those characters need to escaped but adding and removing backslashes doesn’t make this query succesful

Finally I made some regex that works:

this regex stuff looks incredibly difficult and strange in the beginning but I was able to make this with the help of this page: after trying dozens of queries that didn’t work.