Re: [F&O] regular expressions: non-capturing groups

Hi David

On Tue 2004-11-23 David Carlisle wrote:
[...]
> In this case you don't need non capturing groups, you can just grab all
> potential keywords (eg [a-z]+) in the analyze-string, then test to see
> what you have before deciding whether to add the keyword markup, eg
> changing your code to
> <xsl:template match="programlisting[@role='pseudocode']/text()">
>   <xsl:analyze-string select="."  regex="[a-z]+">
>     <xsl:matching-substring>
>        <xsl:choose>
>       <xsl:when test=". = ('while','true','if','else','end')">
>       <span class="keyword">
[...]

Thanks, I'll see how far that gets me (there are more complex cases,
where non-capturing groups probably would be handy).

Tobi

-- 
to
  bi
    as
  re
if

Received on Tuesday, 23 November 2004 16:38:17 UTC