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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -