[tpm] I wish I was better at regex's

Tom Legrady legrady at gmail.com
Wed Mar 9 11:37:57 PST 2011

I would do it using a capturing split() on /([#"])/, which splits

Before the string "Inside the string" # comment

[ 'Before the string',
  'Inside the string',

Before entering the array, you are obviously not in a string, not in a
comment ... as you process elements, you find where you are. If you want to
detect more 'separator characters', they're simple to add, and simple to
handle depending on whether you are in a string, comment or other/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20110309/011c1889/attachment.html>

More information about the toronto-pm mailing list