Anyway, here's an alternative: it replaces the text by itself if the number is small enough (effectlively doing nothing as a result), by 'TEXT' if it needs replacing.
$bar =~ s/(varchar\s*\((\d+)\))/$2 >= 256 ? 'TEXT' : $1/gei;
In reply to Re: String replacement with regex...
by bart
in thread String replacement with regex...
by amonotod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |