in reply to Re: Whats your favorite nonstandard regex quote char?
in thread Whats your favorite nonstandard regex quote char?

I like using paired delimiters in this context, usually curlies.

Speaking of quote delimiters, there's a lovely piece of code in Perl_yylex() (in toke.c) to find the matching balanced delimiter of a quoted string:

if (term && (tmps = strchr("([{< )]}> )]}>",term))) term = tmps[5];

Pop quiz: why does this work? Why are the closing delimiters repeated twice?

_____________________________________________
Come to YAPC::Europe 2003 in Paris, 23-25 July 2003.

  • Comment on Re:x2 Whats your favorite nonstandard regex quote char? (paired delimiters)
  • Download Code