in reply to Braces

With 5.6 you can solve this with an RE, but you are likely to find it much easier to use Damian's Regexp::Common than figure out how to roll your own.