[Jax.PM] ~9M lines of data

J Proctor jproctor at marlboro.edu
Mon Oct 14 22:00:36 CDT 2002


> Which is the default?
>
> /\s/  or / /  ?

Perl 6's regex engine will, when it's complete, default to the style we
currently know as /x.  If you want to match whitespace, you'll have to
explicitly ask for it.  I'm sure there's a way to ask for a literal space
(as opposed to \n, \r, or \t), but it's not / / (that's the regex
containing a single space).


> I thought the \s was "more portable - therefore more beneficial"?

It is.  But you're not worried about portable; you're worried about speed
to chug through ~9M lines of data, on a known platform, for limited use
towards a specific purpose (getting data from Blackboard to some other
app so you can fix it).

Again, for those of you who may feel I'm imparting some great wisdom:

I'm far too lazy to actually go test /\s/ vs / / to see which, if either,
is faster; without doing so I will make no claim either way.  I've merely
speculated that I could imagine / / being faster, because ultimately a
regex comes down to character comparisons, and one is faster than four.


j




More information about the Jacksonville-pm mailing list