Ambran
Ambran

Reputation: 2627

What's wrong with this regex on PostgreSQL?

Can anyone explain to me why this regex select returns false in PostgreSQL:

select '354902050487064_Gismo3' ~* '\d{15}_\w+'

Tried it on several online regex testers and in matches fine.

Thanks

Upvotes: 0

Views: 71

Answers (1)

Toto
Toto

Reputation: 91385

You have to escape the backslashes:

select '354902050487064_Gismo3' ~* '\\d{15}_\\w+'

Upvotes: 1

Related Questions