2023 Jan 31 2:45 PM
Hi,
the following String is given: '{12ZT-}716Ghdnsba'.
I want to cut the text within the Brackets, so the result would be '716Ghdnsba'.
Can anybody show me the approach with Regular Expressions? (regex?)
2023 Jan 31 3:16 PM
You can replace a regex pattern in a string using a syntax such as
REPLACE PCRE <regex pattern> IN <string> WITH ``.
For example try with a pattern such as \{.*\} (try demo report DEMO_REGEX)
2023 Jan 31 3:40 PM
PCRE or POSIX?
or just use substring_after( ... sub = '}' ), no?
2023 Jan 31 3:47 PM
DATA: v_string TYPE string VALUE '{12ZT-}716Ghdnsba'.
REPLACE PCRE '\{.*\}' IN v_string WITH ''.
2023 Jan 31 9:13 PM
Or something like this
match( val = '{12ZT-}716Ghdnsba' regex = '[^}]*$' )