in reply to Re: Can anyone make this regex job neater?
in thread Can anyone make this regex job neater?

lol - mine turned out incredibly similar:
s#^(OBX(?:.*?\|){2})([^^]+)#$1.join'',map{/[A-Z]/?"U$_":/[a-z]/?"L$_": +$_}split'',$2#e;
And no, I didn't read yours first :)

cLive ;-)

Replies are listed 'Best First'.
Re^3: Can anyone make this regex job neater?
by Skeeve (Parson) on Oct 11, 2005 at 21:54 UTC
    So let's go for another one:
    $_="OBX|NM|aaA..^Haem^RD2|7.5|g/dL|13.0-18.0|OR|";s#^(OBX\|[^|]+\|)([^ +^]*)#$1 . join("",map( { my $x=$_; y/A-Z/U/ || y/a-z/L/; "$_$x" } spl +it //,$2)) #e
    Update: 2 downvotes? Would be nice to know why.

    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%.+=%;.#_}\&"^"-+%*) +.}%:##%}={~=~:.")&e&&s""`$''`"e