FIF
FIF

Reputation: 223

Match any character except line break (mysql regex)

I would like to use a regex using regexp instruction in a mysql query. The regex contains a rule any character except line break.

SELECT * FROM column regexp 'EXP1.*=*.*EXP2'

But mysql seams to treat .* as any character including line break

Any ideas how to change the regex to match any character except line break

Thanks

Upvotes: 13

Views: 17082

Answers (1)

CAustin
CAustin

Reputation: 4614

Depending on your line ending style, you could either use [^\n]* to match anything other than line feeds, or [^\n\r]* to match anything other than line feeds and carriage returns.

Upvotes: 23

Related Questions