|
Subject: Re: [xsl] xslt 2.0 regex and how to test it From: "Manfred Staudinger" <manfred.staudinger@xxxxxxxxx> Date: Sun, 19 Mar 2006 00:36:55 -0800 |
> <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
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] xslt 2.0 regex and how to, Florent Georges | Thread | Re: [xsl] xslt 2.0 regex and how to, Florent Georges |
| [xsl] XSL-FO: Suppressing Header on, Jordan (Wraezor) | Date | [xsl] Re: How to strip partial text, Gerard Bierens |
| Month |