in reply to question : regex
in that case, this may be appropriate (UNTESTED):
$string =~ s/ __ (?: [a-zA-Z]_ ){1,2} /__/xms;
i also assume there is only one instance of the sub-string in a string, and so the /g regex modifier is not needed. also, that variations on the sub-strings "__AA_" and "__AA_AA_" will not occur.
note: more examples would help the humble monks to better understand the requirements.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: question : regex
by Anonymous Monk on Oct 11, 2007 at 08:18 UTC |