0

I need a regex pattern to get everything after semicolon in postgres.

I have a string '1234;4567' and I need a result: '4567'. I know I need a substring(string from regex), but I have a problem with creating such regex.

Thanks in advance!!!

0

1 Answer 1

2

You don't really need a regex for that:

select substr('1234;4567', strpos('1234;4567', ';') + 1)

if there is never more than one ; in the string, you can use split_part():

select split_part('1234;4567', ';', 2)
Sign up to request clarification or add additional context in comments.

Comments

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.