
-----Original Message----- From: John Maddock [mailto:john_maddock@compuserve.com] Sent: Thursday, May 29, 2003 4:10 AM To: Boost-Users@yahoogroups.com Subject: Re: [Boost-Users] Regex: matching either of 2 fields, in any order
Is it possible to do this in a single operation, given that the order of the fields is arbitrary?
Yes do a conditional search and replace:
search for "C(\\d+)|O(\\w+)"
and replace with "(?1first-text)(?2second-text)"
don't forget to set the flag format_all when calling regex_merge to do this (in future conditional replacements will only be enabled when actually requested).
Thanks for the reply! 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? ------------------------------ John Wismar BSA - AllData Offline Products john.wismar@alldata.com