C
C3
Hi everyone,
I have a text line that looks something like the following.
text1
text2
HEADER_1
interesting stuff
HEADER_2
text3
text4
text5
HEADER_3
more interesting stuff
....
HEADER_4
text6
text7
HEADER_3
even more interesting stuff
HEADER_4
text8
text9
HEADER_1
unbelievably interesting stuff
HEADER_2
HEADER_1 and HEADER_2 are corresponding opening and closing tags for one
type of content, with a similar arrangement for HEADER_3 and HEADER_4.
It is possible to write a regex to match either HEADER_1 or HEADER_3, but
can this be extended to match the content, and HEADER_2 and HEADER_4? Is it
possible to write a single regex to match either HEADER_1 or HEADER_3
followed by content followed by the corresponding HEADER_2 or HEADER_4 which
depends on whether HEADER_1 or HEADER_3 was matched?
I need to grab everything between HEADER_1 and HEADER_2, and everything
between HEADER_3 and HEADER_4, while keeping it in order. What would be the
simplest and/or cleanest way of doing this?
Thanks.
C3
I have a text line that looks something like the following.
text1
text2
HEADER_1
interesting stuff
HEADER_2
text3
text4
text5
HEADER_3
more interesting stuff
....
HEADER_4
text6
text7
HEADER_3
even more interesting stuff
HEADER_4
text8
text9
HEADER_1
unbelievably interesting stuff
HEADER_2
HEADER_1 and HEADER_2 are corresponding opening and closing tags for one
type of content, with a similar arrangement for HEADER_3 and HEADER_4.
It is possible to write a regex to match either HEADER_1 or HEADER_3, but
can this be extended to match the content, and HEADER_2 and HEADER_4? Is it
possible to write a single regex to match either HEADER_1 or HEADER_3
followed by content followed by the corresponding HEADER_2 or HEADER_4 which
depends on whether HEADER_1 or HEADER_3 was matched?
I need to grab everything between HEADER_1 and HEADER_2, and everything
between HEADER_3 and HEADER_4, while keeping it in order. What would be the
simplest and/or cleanest way of doing this?
Thanks.
C3