[xquery-talk] regular expression question

Howard Katz howardk at fatdog.com
Tue Jun 28 14:46:15 PDT 2005

I haven't done much to date with regular expressions, so here's what I'm
sure is a very easy question (if you know the answer! :-)

I have <p> elements containing text that is separated internally by either
comma or semicolon delimiters or both. I want a regular expression that'll
let me tokenize a <p> element into its constituent pieces only if it
contains one or more comma separators and *doesn't* contain a semicolon. Ie,
what's goes in the regular expression slot for

   for $p in ... /p
       if ( fn:matches( $p, " ??? comma-yes semicolon-no ??? " ))
       then let $tok := fn:tokenize( $p, "," )
       else ...


More information about the talk mailing list