RE: [Boost-Users] Regex: matching either of 2 fields, in any order
That's it exactly. And your explanation was a lot more succinct than mine, too! Thanks. ------------------------------ John Wismar BSA - AllData Offline Products john.wismar@alldata.com
-----Original Message----- From: Jim.Hyslop [mailto:jim.hyslop@leitch.com] Sent: Friday, May 30, 2003 6:10 AM To: 'Boost-Users@yahoogroups.com' Subject: RE: [Boost-Users] Regex: matching either of 2 fields, in any orde r
I can see how I could do this in a loop to replace the different subfields. Is there another step I would need to take to guarantee that there is at most one of each type of subfield?
Well if you search for "C(\\d+)|O(\\w+)" it can only match one or the other can't it? Or am I missing something? I could be wrong, but I interpreted the OP's question to mean: is it
John Maddock wrote: [unknown] wrote (please try to attribute quotes) possible to have the regex generate an error if more than one sub-field of a specific type is found, i.e. the following would be invalid:
~C123~C345
The original poster can correct me if I've misinterpreted anything.
-- Jim
------------------------ Yahoo! Groups Sponsor ---------------------~--> Get A Free Psychic Reading! Your Online Answer To Life's Important Questions. http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/EbFolB/TM -------------------------------------------------------------- -------~->
Info: http://www.boost.org Wiki: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl Unsubscribe: mailto:boost-users-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
That's it exactly. And your explanation was a lot more succinct than mine, too! Thanks.
I could be wrong, but I interpreted the OP's question to mean: is it possible to have the regex generate an error if more than one sub-field of a specific type is found, i.e. the following would be invalid:
~C123~C345
OK, negative forward lookahead asserts can be used for that: "~C\\d+(?!.*~C\\d)" John.
participants (2)
-
John Maddock
-
john.wismar@alldata.com