0
Using REGEX it is possible to "concatenate" masks to bring different parts of the same string?
How do I scan a string and bring different parts of it?
I have a text field with the following information:
00200.035219/2012-15 (VOLUME 1)
I want the return to be exactly like this:
00200.035219/2012-15;1
The information you have after the semicolon always refers to the volume number.
I am using PL/SQL and REGEX.
Can return subgroups using regex: https://regex101.com/r/kemtne/1
– rdleal
@Panther Thank you very much! The regular expression I needed was just that. I only had one question: Which method should I use to write on the screen the subgroups $1;$2?
– Lucas Vinícius
You can use the function REGEXP_REPLACE. Ex.:
SELECT REGEXP_REPLACE(field, '([^ ]+) \(VOLUME ([^)]+)\)', '\1;\2') "replaced_field" FROM table
.– rdleal