Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: A refactoring trap

by bart (Canon)
on Aug 17, 2005 at 11:27 UTC ( #484368=note: print w/ replies, xml ) Need Help??


in reply to A refactoring trap

You don't have to use /[#]/x, you can use /\#/x just as well; just like you more or less have to use /\ /x in order to be able to match a space.


Comment on Re: A refactoring trap
Select or Download Code
Replies are listed 'Best First'.
Re^2: A refactoring trap
by Anonymous Monk on Aug 17, 2005 at 11:57 UTC
    /[ ]/x matches a space as well.
      But the regular expression engine is more likely to be able to optimize a literal character as opposed to a character class.
        That's true. Pity noone has written an optimizer-optimizer which translates one character character classes to literal characters.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://484368]
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: (12)
As of 2015-07-28 15:52 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 (257 votes), past polls