[xquery-talk] regular expression question
Michael Kay
mhk at mhk.me.uk
Tue Jun 28 23:38:46 PDT 2005
Being an old-fashioned XPath 1.0 sort of person, I would tend to write
contains($p, ',') and not(contains($p, ';'))
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: talk-bounces at xquery.com
> [mailto:talk-bounces at xquery.com] On Behalf Of Howard Katz
> Sent: 28 June 2005 21:46
> To: talk at xquery.com
> Subject: [xquery-talk] regular expression question
>
> 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
> return
> if ( fn:matches( $p, " ??? comma-yes semicolon-no ??? " ))
> then let $tok := fn:tokenize( $p, "," )
> else ...
>
> TIA,
> Howard
>
> _______________________________________________
> talk at xquery.com
> http://xquery.com/mailman/listinfo/talk
>
More information about the talk
mailing list