Again, a regex issue -
I am spamming a forum full of questions about Regex, but I need your help.
I have the following file:
& lt ;! - Defines the template for tabs - & gt; & Lt; Div class = "tab" & gt; & Lt; Ul role = "tablist" & gt; {{BOS: sequence}} & lt; Li role = "tab" class = "{{TabType}}" id = "{{tabId}}" & gt; & Lt; Period & gt; {{TabFile}} & lt; / Span & gt; & Lt; / Li & gt; {{EOS: Sequence}} & lt; / Ul & gt; & Lt; / Div & gt;
Now, I want everything between {{BOS: Sequece}} and {{EOS: sequence}}, tags can be included, I can filter them.
I have comed with the following regex:
({{BOS: sequence}}) [.] * [\ S \ S] * ({{EOS: Sequence}})
This is working correctly, but ...
However, when the following changes occur in my content
< Pre> & lt; ! - Defines the template for tabs - & gt; & Lt; Div class = "tab" & gt; & Lt; Ul role = "tablist" & gt; {{BOS: sequence}} & lt; Li role = "tab" class = "{{TabType}}" id = "{{tabId}}" & gt; & Lt; Period & gt; {{TabFile}} & lt; / Span & gt; & Lt; / Li & gt; {{EOS: Sequence}} & lt; / Ul & gt; & Lt; / Div & gt; {{BOS: sequence}} & lt; Li role = "tab" class = "{{TabType}}" id = "{{tabId}}" & gt; & Lt; Period & gt; {{TabFile}} & lt; / Span & gt; & Lt; / Li & gt; {{EOS: Sequence}}
Then click again:
{{BOS: sequence}}
Any ideas about solving this particular problem?
PS: I am writing javascript regex.
Your regex should be:
{{BOS: sequence} } [\ S \ S] *? {{EOS: Sequence}}
Comments
Post a Comment