Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror

Comment Re:You could speed up your current solution (Score 1) 190

Write something that uses a regular expression library (RE2 would be ideal, if your expressions are actually regular), and keeps the compiled patterns resident. Most of your time is likely spent parsing the patterns.

I'm probably going to get shat on by kids who don't know any better, but....

Use Perl. If a complex set of regular expressions is taking 15 seconds per email, then there's clearly something wrong with the implementation. I suspect you're doing too much backtracking. I've been guilty of the same in the past. In one case, simply anchoring my regular expressions to the start and end of the string reduced running time literally by two orders of magnitude. Just glom the whole message into a string and go nuts.

And before someone makes a 'write-only' joke about Perl regular expressions, I'd suggest you take a look at Perl 6 regex grammars, which provide you with the ability to lay out complex rulesets with ease - and makes them vastly easier to read.

As with any programming issue, it's horses for courses, and when it comes to parsing text with regular expressions, Perl is still at the head of its class.

User Journal

Journal Journal: Well, that about wraps it up for e-trade. 2

E-mail to Neal Martin, E-trade's vice president of customer service:

Well Neal,

I doubt that this message will actually get to you personally, but what the hell.

After the fracas over the last few weeks in which e-trade failed to issue me a second ATM card, I finally got around to transferring the bulk of my shares to a competent broker.

The automatic mail from e-trade notifying me of the transfer included this paragraph:

Slashdot Top Deals

"An idealist is one who, on noticing that a rose smells better than a cabbage, concludes that it will also make better soup." - H.L. Mencken

Working...