How can I search for regular expressions within webpages using Google Chrome or IE?
Using Javascript to match regular expressions
Maybe you want try this at chrome's console:
var p=/.*(regu).+?\ /gi; console.log( document.body.innerText.match(p) );
Just open console, copy and paste above to consele and hit enter. You can test it here at this page.
This can be improved if it fits in.
This can be improved if it fits in.
Here we print to console match indexes and matched text. Here we try to match text that contains
regu
, 20 chars before (or less if start of line) and 10 chars after (or less if eol).var p=/.{0,20}regu[^ \n]+[^\n]{0,10}/gi;
while (m = p.exec(document.body.innerText)) {
console.log( 'Index: '+m.index+' Match: '+m ); }
Please read full article from How can I search for regular expressions within webpages using Google Chrome or IE?
No comments:
Post a Comment