perl - Regex: extract a number from a string and place it in a new string -


I want to replace a part of the text in PDF using changepagestring.pl - Search and replace all PDF pages. This device requires two regex strings: replacement and what a replacement code is. Here's the code I'd like to change:

  if (this.hostContainer) {try {this.hostContainer.postMessage (['newpage', 'pp_322', 1525 9]); } Hold (e) {console.println (e); }};  

part pp_322 is different and number 322 is an example. After (s) the character (s) of PP_ is an Arabic numeral (0-9), only the regex should match.

I would like to extract this number and put it in this code:

  this.zoomType = zoomtype.pref; This.pageNum = ExtractedNumber-16;  

Edit:

I think I'm a bit closer this code works but maybe it's small.

  (? & Lt; = pp_) \ d + (?: \ '\ D +)?  

I want that number to be found (possibly buggy code), but how to keep this extractedNumber?

  this.pageNum = ExtractedNumber-16;  

Thanks for the help.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -