Code Monkey home page Code Monkey logo

chrome-regex-search's Introduction

Chrome Regex Search

An extension for Regex Search in lieu of Chrome's CTRL+F.


Instead of writing a program to download a web page to find regex matches, use this simple extension to highlight regex matches on the web page dynamically as you type.

Offers customizable highlighting, case-insensitive and instantaneous search in the extension options.

Also, offers a search history that can be configured to the max number of records.

Note that textarea and input elements will not be highlighted as they cannot be styled by CSS3 natively.

Installation

Go to https://chrome.google.com/webstore/detail/chrome-regex-search/bpelaihoicobbkgmhcbikncnpacdbknn?hl=en&gl=US Click 'Add to Chrome'

Screenshots

Four letter words

Customizable settings

Keyboard Shortcuts

ENTER : select next regex match on page
SHIFT+ENTER : select previous regex match on page

Instructions to set up a keyboard shortcut to open the popup:
In your browser, go to chrome://extensions/shortcuts
Scroll to Chrome Regex Search
Click 'Keyboard Shortcuts'
Type your custom command (ie CTRL+SHIFT+F)
Now whenever, you want to open the popup simply enter your custom command.

License

Chrome Regex Search is under the MIT license. See the LICENSE file for details.

chrome-regex-search's People

Contributors

chrismwendt avatar cxw42 avatar mtiigi avatar rogershen avatar uzitech avatar xzzv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chrome-regex-search's Issues

Feature Request

An Option to keep the search box open and closed only when we use the close button would be very useful when we are searching in many tabs.

Regards :octocat:

Search in PDFs

The normal search of Chrome is able to search in opened PDFs.

It would be nice of if the regex search would also be able to do that.

Please add support for searching in iframes

Some sites use iframes to show main content, but searching inside them not possible.
It will be very useful if your extension will support searching text in iframes.
Will you plan to add this functionality?

Highlight search text when re-opening search box via hotkey

Roger, would it be possible for the search form to open with previously-entered text selected in the input field? That way, if I had a new regex to enter, I could type it without first having to clear the field.

Example: I have v1.0.2 installed and mapped to Ctrl+Shift+F. When I hit the hotkey and enter a regex, everything works fine. I then hit Esc to close the search box, and hit Ctrl+Shift+F again. The text I entered is still there (which is fine), but the text is not selected. In order to start a new search, I have to clear the box first.

There is an easy workaround, of course - Shift+Home, Del to clear the box :) . However, I also use Chrome's built-in find (Ctrl+F) for plain-text searching. The behaviour I am requesting is the same as that of the Chrome find. The consistency between the two would make it much easier for me to use Regex Search without regular "Oops --- forgot to clear the box!" moments.

Thanks for considering this request!

Chris White

Better documentation about supported RegEx syntax

Having just installed this Chrome extension, I was surprised that there were no mention of the supported RegEx syntax. Neither on the Chrome Webstore, here on the ReadMe, in the extension itself (Right-click>Help), nor is it mentioned in an issue here on GitHub.

It would be REALLY useful with a compact "cheat sheet" for those who do not recall which character class shortcut to Word Break, how to express a Reluctant quantifier, or specify negative lookbehind.

Also, from within the extension context menu, it would be useful with a link to a complete syntax reference for the RegEx dialect.

Allow choose tags where to search

Provide a mechanism to allow filter the tags the code will apply regex.

For example, consider the site containing the GNU BASH manual https://www.gnu.org/software/bash/manual/bash.html

Suppose you want find the doc of "declare" builtin. Then, you search for "^declare$"., in order to find the section where contents about "declare" are. Currently, the RegExp extension searches 27 matches.

This is due fact that inside the page, there are many "declare" words inside tags like "code", "var", etc. This is nice, because our search finds reals mentions to the "declare builtin" or some code about it, not only a "declare" simple word...

But, we want a way to search a "declare" that is not middle of a text. For example, if a can specify the "^declare$" apply only to text nodes inside "dt" tag, then, i could find the desired declare. Or better, if i can exclude the any text node inside a "var", or "code" tag, this is useful also.

New User - 2 Requests

Hi. I love it! I've set it to Ctrl-F. :)

I do both case sensitive and insensitive searches. Having to pull up the Options page to switch between the two modes is a bit of a nuisance. I wonder if this option could be moved to the search box instead?

The only thing I miss, compared to Chrome's search, is marking the finds on the scroll bar. Any chance of this? Even if it meant adding a bar next to the scroll bar, I think it would be handy.

Thanks!

Operate on file:// URLs also

Nice extension! Would you please update the manifest (and source?) so it will also work on file:// URLs? My use case involves a lot of locally-stored HTML.

I have not done any Chrome extension development myself, but found this doc page and this SO question* that suggest adding "file://*/*" to the matches in manifest.json should do it.

Thank you!

*Stack Overflow question above by Anthony

Cannot search in local page with generated content

Hello,
Maybe related to #60 since SVG is practically generated content, but maybe different.

I have a locally stored tool that practically does the following, all in Javascript:

  • HTML placeholder page having 3 frames
  • Each frame uses JavaScript to load an XML file and applying an XSL template.
  • Result is two navigation panes, and a content pane.

No matter what I search for, it may even be ".", I get 0 hits.
Yes, allow access files from URLs is enabled. Otherwise, there was a big red warning that this page couldn't be opened.

Question: is the tool supposed to find things:
A) on the page, (contains the contents of the XML file loaded.
B) or in the page source? (contains only javascript, no content)

Feature Request: (Option to) Select all previously entered text on (re-)activation

When you just want to search for something new, hit the shortcut and start typing, it feels "wrong" to then realize that what you typed was simply appended to the last search and now you have to go and manually remove that part.
A boolean option to enable selecting the input's contents on activation would be perfect:

  • Simple to implement
  • People who like the other way better can continue to not use it
  • People who want a feel more akin to the native Ctrl+F behavior are happy 😊

Chrome bug preventing search from working

Today for the first time https://bugs.chromium.org/p/chromium/issues/detail?id=490915 negatively affected me (version below).

Steps: Run a regex search from the popup on any Internet page for text on that page

Expected: Search result count listed in the popup

Observed: Result count stays at 0 of 0

Request: Would you be willing to update the search function to test for the case described below, warn, and still perform a search using the default settings? Thanks for considering this request!

Analysis

Here, the extension (reasonably) assumes Chrome will behave as documented :) . However, Chrome instead returns undefined.

MCVE (in the developer console, with "Chrome Regex Search" selected, after the above error occurs):

chrome.storage.local.get(null,(r)=>{console.log(chrome.runtime.lastError); console.log(r);})
undefined
{}
    message: "IO error: .../LOCK: Access denied. (ChromeMethodBFE: 15::LockFile::5)"
    get message: Ζ’ ()
    __proto__: Object
undefined

Browser

Chromium 76.0.3809.87 (Official Build) snap (64-bit)
Revision 111fe1e15d5ced26080a7dc239bcfe70f6c49aad-refs/branch-heads/3809@{#967}
OS Linux (Ubuntu 18.04.2 LTS)
JavaScript V8 7.6.303.27
Flash (Disabled)
User Agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) snap Chromium/76.0.3809.87 Chrome/76.0.3809.87 Safari/537.36
Command Line /snap/chromium/813/usr/lib/chromium-browser/chrome --no-default-browser-check --no-first-run --password-store=basic --profile-directory=Default --flag-switches-begin --disable-smooth-scrolling --disable-features=HardwareMediaKeyHandling --flag-switches-end
Executable Path /snap/chromium/813/usr/lib/chromium-browser/chrome
Profile Path /home/cwhite/snap/chromium/813/.config/chromium/Default

Performance issues when opening dialogue

When I use a keyboard shortcut to open Chrome Regex Search and immediately start typing a query string, the first few characters in my query string are lost. Sometimes, the first character or two end up in a text field on the web page, even though I type them after the keyboard shortcut. I don't mind that the dialogue takes a little while to appear (a few hundred milliseconds), but I'd map this extension to Ctrl+F if none of the characters I typed got lost.

Chrome 65 under Linux Mint 18.1 64b (Cinnamon 3.2.7) on an admittedly old laptop (dual core i7 @ 2.90GHz).

code formatting seems to break the extension

I am trying to search for for loops in some python code examples for a module.

I can see one on the screen so I know where it should be highlighted.
in the search bar I use:
for\s\w+\sin
to search for "for" followed by a whitespace character, then any variable name, followed by another whitespace character and finally the word "in"

This formula works for text on the page that is not formatted as code, but not if it is in a code block.
image

The extension CAN find single words in code blocks, if I search for just "for" it manages to find them in code blocks (as well as outside of them)

in fact white space in code formatting seems to completely block this extension (even when using .* to select ALL characters following the searched string):
image

Here I have searched for all examples of the characters "de" and then everything that follows them. as you can see, the white space in the code blocks ends this search.

Interestingly there is no issue with chrome's standard Ctrl+F function, that can find full sentences inside of code blocks.

Feature Request: Search Form Input Values

It would be nice if we can use regex search in pages with forms. In other words...find matches within the content of text input or text area fields (maybe even select options).

I'm sure it's common for people to need to find fields containing one or more values in order to change them. In my case, I am updating a product with either of two color options.

I'll try to clone this project and give it a try at this if I can find some time, but wanted to open this feature request first.

i cant search for '+++'

System: Host: linux-fcke Kernel: 4.12.8-1-default x86_64 bits: 64 gcc: 7.1.1
Desktop: KDE Plasma 5.10.4 (Qt 5.9.1) dm: sddm,sddm Distro: openSUSE Tumbleweed 20170822

Information for package google-chrome-beta:

Repository : google
Name : google-chrome-beta
Version : 61.0.3163.59-1
Arch : x86_64
Vendor : Google Inc.
Installed Size : 343.7 MiB
Installed : Yes
Status : up-to-date
Source package : google-chrome-beta-61.0.3163.59-1.src
Summary : Google Chrome (beta)
Description :
The web browser from Google

Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier.

using extension https://chrome.google.com/webstore/detail/chrome-regex-search/bpelaihoicobbkgmhcbikncnpacdbknn/support?utm_source=chrome-app-launcher-info-dialog

tested on this site https://cgit.kde.org/konversation.git/commit/?id=72de2027f3d3e7a0c48aef6acd666e04fc0b19b1

Support Anchor Characters in Pattern

Regular Expression patterns should be able to use ^ and $ characters to denote the start and end of the line, respectively. However, these characters cause the pattern to not match at all.

Can't search for superscript and normal text together

I'm trying to find text on a page that uses the HTML tag for superscript and the add-on is not able to search for text which spans the sup tag.

For example this page (it's quite large): http://oracc.museum.upenn.edu/cams/gkab/cbd/akk/onebigfile.html

If you Ctrl-F "dubdub" in the normal Chrome search you find four text matches, however when you do the same search with the add-on you only get two. The two missing from the add-on are strings where half of the search term appears in superscript.

Doesn't seem to search within frames

My main reason for wanting this is to search for things in the AWS console. Unfortunately, CloudWatch Logs (and many others) use iframes. Is there a security limitation that would prevent you from accessing frames?

Add and option to search "accent insensitive"

Please add an option to search no matter of accents.
Something like the "case insensitive" option but ignoring accents instead of capitalization.

For example I would like to find both "ΓΊltimo", "ultimΓ³" and "ultΓ­mo" by just searching for "ultimo".

F3 and Shift+F3 don't work

Although the standard 'find next' and 'find previous' shortcuts in Chrome for Linux and Windows are Ctrl+g and Ctrl+Shift+g, the old standards of F3 and Shift+F3 also work. They ought to work in Chrome Regex Search too.

Text in Unicode bold/italics/etc is not recognized by the search

If you try to search for test here then only the regular variant will be found. The normal search of Chrome handles this case as one would expect.

regular: test
bold serif: 𝐭𝐞𝐬𝐭
bold sans: π˜π—²π˜€π˜
italics serif: 𝑑𝑒𝑠𝑑
italics sans: 𝘡𝘦𝘴𝘡
bold italic serif: 𝒕𝒆𝒔𝒕
bold italic sans: π™©π™šπ™¨π™©

Line match

The pattern "^some text$" dont works and matches "some text" in middle of line.

Typing Japanese directly into the search gives zero results

It looks like if I copy Japanese text and paste it directly into the search, it works. (test: copy this into the search: γ²γ‚‰γŒγͺ)

However, if I type the Japanese directly into the regex search box, it comes up with zero results. (I guess to test this, you need to be able to type in Japanese)

Unable to digest escape sequence

The search is unable to and digest escape sequence.

One example will be to search on the Java API page. When I want to find java.lang.Thread, I search for '.Thread$', but it does not work. The period character isn't escape in the search bar.

[Feature Request] Improve use cases of regex search engine

Often, when we search something in Chrome, we mean to select it for copy paste or to click the link. In Chrome, when we search for something and then hit escape, we have the found entry we were on selected and we can just hit Ctrl + C. Unfortunately, this is not the case here.

  • The text is just highlighted and not selected. As such, I would like to propose that we modify the searcher to make it select the entry we're on instead of highlighting it in a different color and to remove the highlighting when we exit the searcher via Esc.

  • Also, in Chrome, when we hit Ctrl + Enter while we've selected part of a text via Ctrl + F, it has the same effect as clicking that selection. This would also be a very useful feature to have.

Shift + Enter inconsistency

Reproduction:

  1. Search for something with multiple results.
  2. Press Shift.
  3. Press Enter
  4. Release Shift.
  5. Release Enter.
    The order is important. If you mix up 4 and 5, it will work correctly.

When you press Enter, you'll go to the previous result. Ok. But when you release Shift, you'll go forward again.

Support for Vivaldi

I am using Vivaldi browser which is based on Chromium. Regex searches appear to work as they do in chrome, but setting a keyboard shortcut does not. I have it set to ctrl+shift+f and it does not bring up the search dialog. Also, when clicking on the icon, escape does not exit out of it.

This is an awesome add on!

FIle URLs should match file:/// (with three /)

Bug #2 added support for file://, but for me all of my files start with file:/// (with three /, not two) Could you add support fir that? I am not sure if file:// is even a thing as I can not use it - google chrome automaticly adds the third /. I would imagine this would be a quick fix, probally one line. Do you mind adding support for file:///?

Regex templates (shortcut buttons/icons)

https://projects.lukehaas.me/regexhub/
Useful regex can get really long and annoying to write, thus it would be cool if the extension provided small distinguishable icons/buttons for example that fill the regex field (search field) with some regex template code.

I think instead of individual icons, however, it would be easier to just show a list of text, since some regex is pretty specific and hard to translate into an icon.

RE does not work through formatting

On the following US senate vote webpage, I was trying to match the democrats who voted Yes with "D.*Yea" but your tool does not find any, maybe because of the bold tags around the Yea.
https://www.senate.gov/legislative/LIS/roll_call_lists/roll_call_vote_cfm.cfm?congress=115&session=1&vote=00195

I found the votes grouped by position further down the page, so I could answer my question, but in general, a more robust matching of text through HTML formatting would be nice.

failing to load script in chrome

On Chrome Version 87.0.4280.88 (Official Build) (64-bit)

regex extension is working great with nfl.com,
but when I try to use it with a local html report file I get this error

Content script was not loaded. Are you currently in the Chrome Web Store or in a chrome:// page? If you are, content scripts won't work here. If not, please wait for the page to finish loading or refresh the page.

image

if I load the same file to my webserver it works great as well
https://www.securedata.cadenhance.com/spreadsheet_html_report/html_spreadsheet_report_01.html

Can you download the file from the site above and try looking at a local copy?

Repeated <Enter> pressing is not applied

The problem is:
Repeated pressing in the search text box or reselecting the same history record is not applied (doing nothing). It's necessary on interactive pages, e.g. on log pages, since after refreshing the page, the highlighting of the search results will disappear.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.