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.
[reply]
[d/l]
Re^3: A refactoring trap
by
Ven'Tatsu
(Deacon)
on Aug 17, 2005 at 13:56 UTC
But the regular expression engine is more likely to be able to optimize a literal character as opposed to a character class.
[reply]
Re^4: A refactoring trap
by
Anonymous Monk
on Aug 18, 2005 at 09:06 UTC
That's true. Pity noone has written an optimizer-optimizer which translates one character character classes to literal characters.
[reply]
In Section
Meditations