Your posted code will work if you remove the space after the comma in your regex.
/^(.{1, 20}).*/; # doesn't work /^(.{1,20}).*/; # does work /^(.{1,20})/; # even easier
In reply to Re^3: how to shorten given string?
by JediWizard
in thread how to shorten given string?
by mellin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |