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

Eliot Kimber ekimber at rsicms.com
Sat Jan 11 15:24:56 CST 2014


That works. But here+IBk-s another question: why is the outer group with the ?
operator required? I tried just (.+AHwAXA-n)+ACo-, which should match anything
between my start and end strings, but it does not, where ((.+AHwAXA-n)+ACo-?) does.

Thanks,

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




On 1/11/14, 3:08 PM, +ACI-G. Ken Holman+ACI- +ADw-gkholman+AEA-CraneSoftwrights.com+AD4- wrote:

+AD4-At 2014-01-11 13:17 -0600, Eliot Kimber wrote:
+AD4APg-Content-Language: en-US
+AD4APg-Content-Type: text/plain+ADs- charset+AD0AIg-utf-7+ACI-
+AD4APg-
+AD4APg-I++IA-m trying to a regular expression search and replace for things
+AD4APg-like this:
+AD4APg-
+AD4APg-doc: text text
+AD4APg-next line
+AD4APg-next line++AA-/a:documentation++AA-
+AD4APg-
+AD4APg-What I can++IA-t figure out is how to do this multi-line regular
+AD4APg-expression
+AD4APg-match. If use ++IA-dot matches all++IA- then my match is not limited to
+AD4APg-just
+AD4APg-what++IA-s shown but everything between the first doc: and the last
+AD4APvgA-/a:documentation++AA-.
+AD4APg-
+AD4APg-If do e.g. ++IA-doc:(.)++AA-/a:documentation++AD4gA- then it matches
+AD4APg-cases where it all
+AD4APg-happens to be on one line.
+AD4APg-
+AD4APg-Is this possible? What bit of regex fu am I missing?
+AD4-
+AD4-I think it is the use of +ACIAXA-n+ACI-.
+AD4-
+AD4-Try this to include all of the lines:   doc:((.+AHwAXA-n)+ACo-?):documentation
+AD4-
+AD4-(note that I'm guessing what your boundaries are because of a mailer
+AD4-problem)
+AD4-
+AD4-I hope this helps.
+AD4-
+AD4-. . . . . . . . Ken
+AD4-
+AD4---
+AD4-Public XSLT, XSL-FO, UBL +ACY- code list classes: Melbourne, AU May 2014 +AHw-
+AD4-Contact us for world-wide XML consulting and instructor-led training +AHw-
+AD4-Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm +AHw-
+AD4-Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/x/ +AHw-
+AD4-G. Ken Holman                   mailto:gkholman+AEA-CraneSoftwrights.com +AHw-
+AD4-Google profile:      http://plus.google.com/++GKenHolmak-Crane/about +AHw-
+AD4-Legal business disclaimers:    http://www.CraneSoftwrights.com/legal +AHw-
+AD4-
+AD4AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBf-
+AD4-oXygen-user mailing list
+AD4-oXygen-user+AEA-oxygenxml.com
+AD4-http://www.oxygenxml.com/mailman/listinfo/oxygen-user



More information about the oXygen-user mailing list