regex - Regular expression to get last occurence until next char -
i trying work out regular expression , stuck - can help.
i have string:
"this string [flag no match] should match [flag this] dont want [no no]"
i want capture last occurance of flag enclosed in brackets.
tried this:
\[flag(?!.*\[flag)(.*)\]
i there, matches last "]" in string. how can match next "]" following match.
want match this: "this"
get this: "this] dont want [no no"
hope can help.
thanks
Comments
Post a Comment