in reply to Re: String replacement with regex...
in thread String replacement with regex...

You've got a small typo--should be "(\d" instead of "\(d". One other thing with the solutions--they replace all varchars on the line with texts if any of them have over 255 characters. That may not be a problem depending on how things are broken up, but it's something to notice.
CREATE TABLE varchar (15) LastName, varchar (300) Notes
(Apologies if my SQL is off, it's been a long time.) So here's just one more way to do it:
$buffer =~ s/varchar\s*\( (?: \d{4,} | 2 (?: 5 [6-9] \d* | [6-9] \d+ ) | [3-9]\d{2,} )\)/TEXT/gix;