View Single Post
  #1217  
Old 13.03.2020, 10:11
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,553
Default

Quote:
Originally Posted by zreenmkr View Post
could toolbar button or contextmenu action be intercepted? ... If there is a possibility, then I'm thinking get length of crawled in package if it greater than say 20 crawled then terminate the action.
Possible only with context menu commands which execute a script. In this case, can check length of selected links array before opening them in a browser.

Quote:
regex to match last occurrence....
Use greedy quantifier when you want to get the longest match before the last occurrence.

Code:
var file = 'Stay healthy by walking everyday aby John Doe';

var regex = /.*by\s(.*)/i;
var authorName = file.replace(regex, '$1');

alert(file + '\r\n' + 'authorName: ' + authorName);
Reply With Quote