[oXygen-user] How to match across multiple lines using regex?

Eliot Kimber ekimber at rsicms.com
Wed Jan 15 09:59:17 CST 2014


Thanks, that clarifies things.

I did look in the online help but didn’t find any specific guidance on
regular expressions beyond “Oxygen uses Perl regular expressions”. I think
at least a brief topic on regular expression syntax would be helpful, with
a pointer to more information elsewhere.

Cheers,

E.
-- 
Eliot Kimber
Senior Solutions Architect
"Bringing Strategy, Content, and Technology Together"
Main: 512.554.9368
www.reallysi.com
www.rsuitecms.com




On 1/15/14, 8:24 AM, "Oxygen XML Editor Support" <support at oxygenxml.com>
wrote:

>
>
>
>Hi Eliot,
>
>The ? operator makes it a lazy match (first best match) instead of a
>greedy match (longest possible match).
>Without the ? operator the expression is greedy and will match a lot more
>content than expected.
>
>You can use either (.|\n)*? or .*? with "dot matches all", but in either
>case the ? operator is the one that limits the search to the first best
>match.
>
>Regards,
>Adrian
>
>Adrian Buza
>oXygen XML Editor and Author Support
>
>Tel: +1-650-352-1250 ext.202
>Fax: +40-251-461482
>support at oxygenxml.comhttp://www.oxygenxml.com
>
>On 11.01.2014 23:24, Eliot Kimber wrote:
>
>
>That works. But here’s another question: why is the outer group with the ?
>operator required? I tried just (.|\n)*, which should match anything
>between my start and end strings, but it does not, where ((.|\n)*?) does.
>
>Thanks,
>
>E.
>
> 
>_______________________________________________
>oXygen-user mailing list
>oXygen-user at oxygenxml.comhttp://www.oxygenxml.com/mailman/listinfo/oxygen-
>user
>
>



More information about the oXygen-user mailing list