[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Ungready Flag on Regex
Hello ! I have a regex that tries to detect bold parts in a markdown string. In markdown, bold parts are delimited with ****. For example : Not bold but **this one is blod** text. Here, *"this one is bold"* should be dispayed as bold text. For this, I use this regex : <xsl:analyze-string select="$s" regex="\*\*[^*]*\*\*"> ... </xsl:analyze-string> Now, I have a string that contains comments markers, and these markers should be displayed in bold : Comments are delimited by **/* */** or prefixed by **//** */* */* should be in bold, *//* should be in bold, but *"or prefixed by"* should not be in bold. My regex can't do that. But with PCRE (PHP) regex, I can use flag "U" (ungready, that make quantifiers lazy), and with this flag, I get exactly what I expect. Is there an equivalent of Ungready tag, or a syntax that let me get what I want ? Best regards, Christophe
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|