This might be easiest:
$field =~ s/((.)(?:\\|\/)(.))/ if ($2 eq 'C' && $3 eq 'O') { $1 } elsif (ord($2) >= ord('0') && ord($2) <= ord('9')) { $1 } elsif (ord($3) >= ord('0') && ord($3) <= ord('9')) { $1 } else { "$2 & $3" } /xeg;
Update: I had a "==" where I needed a "eq". Also fixed the problem Roy found.
In reply to Re: Regex Question
by ikegami
in thread Regex Question
by shemp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |