in reply to String replacement with regex...
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;
|
|---|