inexperienced1
IS-IT--Management
I need some help building a regular expression.
Simply put I need to find a ection of text with specific start text and specific end text, but allowing for repetition in between
Ie
Find START and stop at END making sure they are at the same level.
If the text is
START adslhf START sfdlhadsa END END
I would want
1) START adslhf START sfdlhadsa END END
2) START sjdkhfa END
Not
1) START adslhf START sfdlhadsa END
2) START sjdkhfa END
or
START adslhf START sfdlhadsa END END
I have found, but this does not quite work as it returns all values
(((?<Open>START)[^START|END]*)+((?<Close-Open>END)[^START|END]*?)+)*(?(<Open>)(?!))$
Can anyone help me identify to correct pattern?
Simply put I need to find a ection of text with specific start text and specific end text, but allowing for repetition in between
Ie
Find START and stop at END making sure they are at the same level.
If the text is
START adslhf START sfdlhadsa END END
I would want
1) START adslhf START sfdlhadsa END END
2) START sjdkhfa END
Not
1) START adslhf START sfdlhadsa END
2) START sjdkhfa END
or
START adslhf START sfdlhadsa END END
I have found, but this does not quite work as it returns all values
(((?<Open>START)[^START|END]*)+((?<Close-Open>END)[^START|END]*?)+)*(?(<Open>)(?!))$
Can anyone help me identify to correct pattern?