in reply to regex to remove all non a-z and spaces
I wouldn't have expected the i flag solution to be more efficient, but there you go. There are significant savings from +. The most efficient regex therefore is:
EDIT: You're right, tr/// is much faster.$str =~ s/[^a-z8-9 ]+//ig;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex to remove all non a-z and spaces
by bmann (Priest) on May 16, 2005 at 04:09 UTC | |
|
Re^2: regex to remove all non a-z and spaces
by coldfingertips (Pilgrim) on May 16, 2005 at 04:19 UTC | |
by muntfish (Chaplain) on May 16, 2005 at 08:56 UTC |