Boost logo

Boost Users :

From: john.wismar_at_[hidden]
Date: 2003-05-28 11:42:52


I have a string that I'm searching, with sub-fields that are delimited
by '~'. I'm particularly interested in 2 of the fields, either of which
may or may not exist, in an unspecified order, and are identified by an
initial 'C' and 'O' respectively. The 'C' is always followed by one or
more digits, the 'O' is followed by one or more characters.

For example, these are all valid.

~A123~C456~MA4
~C12345~OA1~A123
~A4~MH1

I'd like to see if I can use regular expressions to say, "If there is a
'C' field, replace the digits after it with these digits. If there is
an 'O' field, replace the characters after it with these characters."

I can do this quite easily with two different regex search-and-replaces;
if the fields were always in the same order, I'd have no problem with
that, either. Is it possible to do this in a single operation, given
that the order of the fields is arbitrary?

------------------------------
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