0

I have a problem.

regex :

        \[if\s*\{.*\}(=|!=|>|<).*\].*\[endif\]

and have a string:

        [if {val1}>'443']Hello[endif] developer! [if {val2}=22]Some info[endif]

in string can be repeated many time somethin like "[if {val}>val]text[endif]"

how I can get each match? now this regular expression get all items like one enter image description here

  • Please list the exact match outputs that you want from your example so that I can provide a more accurate answer. Anyway, it looks like your quantifiers are consuming more characters than you expect. Try making them "lazy" by adding `?` after each one: `\[if\s*?\{.*?\}(=|!=|>| – CAustin Feb 14 '19 at 01:19
  • \[if\s*?\{.*?\}(=|!=|>| – Vova Leskiv Feb 14 '19 at 01:24

0 Answers0