I have a string of the following format:
TEXT####TEXT####SPECIALTEXT
I need to get the SPECIALTEXT
, basically what is after the second occurrence of the ####
. I can't get it done. Thanks
I have a string of the following format:
TEXT####TEXT####SPECIALTEXT
I need to get the SPECIALTEXT
, basically what is after the second occurrence of the ####
. I can't get it done. Thanks
The regex (?:.*?####){2}(.*)
contains what you're looking for in its first group.
If you are using shell and can use awk
for it:
From a file:
awk 'BEGIN{FS="####"} {print $3}' input_file
From a variable:
awk 'BEGIN{FS="####"} {print $3}' <<< "$input_variable"