Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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!!!
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():
;
split_part()
select split_part('1234;4567', ';', 2)
Add a comment
Required, but never shown
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.
Explore related questions
See similar questions with these tags.