Have a look at perlre, in particular at the zero-width assertions \A and \z (lower-case z!), and to the meta-character . (dot). But I think that you can easier extract the characters using substr.
In reply to Re: regex for string
by rovf
in thread regex for string
by saranperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |