regular expression questionHoward 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:http://xquery.com/mailman/listinfo/talk] > Sent: Tuesday, June 28, 2005 2:39 PM > To: 'Howard Katz'; http://xquery.com/mailman/listinfo/talk > Subject: RE: 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: http://xquery.com/mailman/listinfo/talk > > [mailto:http://xquery.com/mailman/listinfo/talk] On Behalf Of Howard Katz > > Sent: 28 June 2005 21:46 > > To: http://xquery.com/mailman/listinfo/talk > > Subject: 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 > > > > _______________________________________________ > > http://xquery.com/mailman/listinfo/talk > > http://xquery.com/mailman/listinfo/talk > > >
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format