Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another Regex question - find LAST match
#2
Macro Macro1841
Code:
Copy      Help
str s=
;welcome the user is here
;nothing has to be matched from this
;welcome i like it here

str m
if(findrx(s "(?s).*^(welcome(?-s).+here)$" 0 8 m 1)<0) end "not found"
;if(findrx(s "(?:^.*[])*^(welcome.+here)$" 0 8 m 1)<0) end "not found" ;;this also works, don't know which is better
out m

;the * is greedy, ie matches as much as possible, therefore the rest will find the last match


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)