MySql non-greedy regex -
i have following text 'ab{0}c' should considered equal text if difference in text inside curly brackets. eg. ab{hello}c == ab{0}c
the regex expression ab\\{(.*?)\\}c
the problem when try execute regex regexp mysql function giving me following error:
error code: 1139 got error 'repetition-operator operand invalid' regexp the problem '?', if removed expression, regex works fine problem expression becomes greedy match ab{0}c{1} don't want.
any ideas on how solve problem?
change . [^}] (negated character class, matches isn't }) , won't need non-greediness.
^ab\\{([^}]*)\\}c$
Comments
Post a Comment