Boost logo

Boost Users :

From: Lucian Ion (lucianion_at_[hidden])
Date: 2005-05-10 12:59:07


sorry, I mean
4) else, prepend r4 to text
(that is, has nothing to do with the other replacement strings)

----- Original Message -----
From: "Lucian Ion" <lucianion_at_[hidden]>
To: <boost-users_at_[hidden]>
Sent: Tuesday, May 10, 2005 8:50 PM
Subject: regex lib - using replace

> Hi,
> I need one regular expression and one format string to do the following
> 1) if text starts with s1, replace s1 with r1
> 2) else, if text starts with s2, replace s2 with r2
> 3) else, if text starts with s3, replace s2 with r3
> 4) else, prepend r3 to text
>
> While I managed to work out the first three using an expression like
> (^s1)|(^s2)|(^s3) and the format as 1?r1:2?r2:3?r3:
> I have no idea how to include the fourth case into my expression. Any
> suggestion?
>
> Thank you in advance,
> Lucian
>


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