MySQL Forums
Forum List  »  Newbie

How can I extract address, city, state and Postal code from a text separated by * using REGEXP_SUBSTR in MySQL?
Posted by: Muhammad Akhtar
Date: November 17, 2022 06:10PM

How can I extract address, city, state and Postal code from a text separated by * using REGEXP_SUBSTR in MySQL?


REGEXP_SUBSTR(‘4550 Montgomery Avenue*Toronto*Ontario*M4A 2S3*’, ‘(.? ){2}(.?),’)

I get a list of dynamic text which contains address, city, state and Postal code separated by *. Need to exact address, city, state and Postal code using REGEXP_SUBSTR.

I want multiple statements.
one separate call for address
one separate call for city
one separate call for state
one separate call for Postal code


My string is always in this format “address*city*state*Postalcode*” where state is the value after second * till the third *(excluding *).
txs

Options: ReplyQuote


Subject
Written By
Posted
How can I extract address, city, state and Postal code from a text separated by * using REGEXP_SUBSTR in MySQL?
November 17, 2022 06:10PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.