01-08-2014, 11:58 PM
I am trying to find whole numbers in a string. I do not want the numbers followed by dots or dashes This following only returns the number 24.
Macro Macro7
While this return both 24 and 101
Macro Macro8
any ideas. The special character seem to throw off quickmacros. This works find in regexbuddy. The number is a port count of a license file which constantly changes. I want to automatically pull the port count while I modify some other config files.
The only difference is in bold below. I added the a
INCREMENT nss_encryption swilmgrd 6.0 14-jun-2014 24 a\
Macro Macro7
str s osr tts t
s = "INCREMENT osr_swirec swilmgrd 10.0 14-jun-2014 24 ISSUED=16-Dec-2013 \"
t = "INCREMENT nss_encryption swilmgrd 6.0 14-jun-2014 101 \"
if(findrx(s "\s\d+\s" 0 2 osr)>=0) out osr.trim
if(findrx(t "\s\d+\s" 0 2 tts)>=0) out tts.trim
While this return both 24 and 101
Macro Macro8
str s osr tts t
s = "INCREMENT osr_swirec swilmgrd 10.0 14-jun-2014 24 ISSUED=16-Dec-2013 \"
t = "INCREMENT nss_encryption swilmgrd 6.0 14-jun-2014 101 a\"
if(findrx(s "\s\d+\s" 0 2 osr)>=0) out osr.trim
if(findrx(t "\s\d+\s" 0 2 tts)>=0) out tts.trim
The only difference is in bold below. I added the a
INCREMENT nss_encryption swilmgrd 6.0 14-jun-2014 24 a\