Boost logo

Boost Users :

From: john.wismar_at_[hidden]
Date: 2003-05-29 10:35:51


> -----Original Message-----
> From: John Maddock [mailto:john_maddock_at_[hidden]]
> Sent: Thursday, May 29, 2003 4:10 AM
> To: Boost-Users_at_[hidden]
> 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_at_[hidden]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net