How to run a regex search on Google Chrome or Firefox?
For Google Chrome, you could install one of the following extensions:
-
Regular Expression Searcher
To open the extension, press /.
To start searching, press Enter.
To jump to the next match, press N.
To jump to the previous match, press Shift + N.
-
Regex Search
To open the extension, press Alt + Shift + F.
To start searching, press Enter.
To jump to the next match, click Next.
To jump to the previous match, click Prev.
After installing the extension, restart your browser. When testing the extension, note that extension are disabled by default on Chrome's "special" pages, such as New Tab or the Chrome Webstore.
Another option is VIMIUM.
The point of this Chrome plugin is to get Vim navigation on your Chrome pages, so you can use keys like J and K to scroll down the page.
However, since it is Vi-based, Vimium supports regular expressions.
Much like Vim, while looking at the page, type "/<regexp>, and it will start searching the page. I don't use it often (I use Ctrl + F much more), but when I need it, it is there and works.
To work with regexp while searching you need to turn it on in the plugin advanced options.
Firefox
I recently went looking for this very feature as I got tired of searching for a word and having to go through all the instances where the word I'm looking for is a sub-string of a larger word.
Regex Find is a nice lightweight extension which enhances the standard Firefox Find Bar by adding an option to treat the search term as a regular expression. It seems to be Open Source as it source code is available on GitHub.
I also like it because it works well with VimFx.
Here's a bookmarklet that'll highlight regular expression searches. It doesn't have incremental search like the native find box, but it does the job. Each new search is highlighted in a different color.