[xquery-talk] regular expression question

Howard Katz howardk at fatdog.com
Tue Jun 28 16:15:47 PDT 2005


Thank you both. I can see the virtues in each approach. I thought the regex
method would be something like that, but I couldn't quite figure it out. The
scary thing is I can actually understand what Tony is doing. :-)
Howard

 > -----Original Message-----
 > From: Michael Kay [mailto:mhk at mhk.me.uk] 
 > Sent: Tuesday, June 28, 2005 2:39 PM
 > To: 'Howard Katz'; talk at xquery.com
 > Subject: RE: [xquery-talk] regular expression question 
 > 
 > 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