0

How can I transfer the following regex from Java to PostgreSQL syntax:

Pattern.compile("(?imu)(P\\W*Ř\\W*E\\W*D\\W*V\\W*O\\W*L\\W*Á\\W*N\\W*Í)"));

I have tried:

select regexp_matches('P Ř E D V O L Á N Í','(?imu)(P\\W*Ř\\W*E\\W*D\\W*V\\W*O\\W*L\\W*Á\\W*N\\W*Í)')

But got ERROR: invalid regular expression: invalid embedded option

1 Answer 1

1

Postgres uses POSIX RE's that don't support the u (Enable Unicode-aware case folding) flag in (?imu)

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. I've ended up with select regexp_matches(upper('PřED vo lÁn í'),'(P[[:space:]]*Ř[[:space:]]*E[[:space:]]*D[[:space:]]*V[[:space:]]*O[[:space:]]*L[[:space:]]*Á[[:space:]]*N[[:space:]]*Í)') Not the same, but seems to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.