php - How to escape parentheses in a REGEXP clause -


in database have keys this:

custom_field_languages(0)language custom_field_languages(1)language custom_field_languages(2)language ... 

and need of them. doesn't work:

regexp '^custom_field_languages([0-9])language' 

this doesn't work.

regexp '^custom_field_languages\([0-9]\)language' 

this works isn't 100% accurate.

regexp '^custom_field_languages.[0-9].language' 

what correct way escape normal parentheses?

you can escape parentheses square brackets, this:

regexp '^custom_field_languages[(][0-9][)]language' 

this useful when need embed query string language provides own interpretation backslashes inside string literals.

demo.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -