xsl-list
[Top] [All Lists]

Re: [xsl] xslt 2.0 regex and how to test it

2006-03-19 01:37:19
        <xsl:value-of select="replace(., '\[[^\]]+\]', '')"/>
Thanks for your solution, works perfect.
Let me try to verbalize the regex (" for better readability): "\[[^\]]+\]"
the string starts with "[" and ends with "]": SingleCharEsc "\[" and "\]"
in between there is a charGroup: "[]"
with a quantifier "+" for one or more occurrences
the charGroup is a negcharGroup, as it starts with: "^"
it contains one character "]": SingleCharEsc "\]",
thus allowing for one or more characters which are not "]".

How do you recommend to test xslt regex? Is it possible to
to see what is actually matched?
I'm not sure what you're looking for ...
I would prefer to try it out with an editor's find. To my surprise
your solution worked fine with SciTE. One difference I noted
was, that SciTE does not need the SingleCharEsc within the
charGroup.

Regards, Manfred

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>