Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: \q quote-matching operator

by diotalevi (Canon)
on Aug 26, 2004 at 13:11 UTC ( #386001=note: print w/ replies, xml ) Need Help??


in reply to \q quote-matching operator

You can add this yourself. See perlre at the end.

package Regexp::Quotes; use overload; sub import { shift; die "No argument allowed to Regexp::Quotes::import" if @_; overload::constant qr => \ &convert; } sub invalid { die "/$_[0]/: invalid escape '\\$_[1]'"; } my %rules = ( '\\' => "\\", 'q' => qr/[\'\" .... ]/ ); # Extend this sub convert { my $re = shift; $re =~ s( \\ ( \\ | q ) ) { $rules{$1} or invalid( $re, $1 ) }gex; $re; }


Comment on Re: \q quote-matching operator
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://386001]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (17)
As of 2015-07-28 19:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls