I'm writing PHP code to parse a string. It needs to be as fast as possible, so are regular expressions the way to go? I have a hunch that PHP string functions are more expensive, but it's just a guess. What's the truth?
Here's specifically what I need to do with the string:
Grab the first half (based on the third location of a substring "000000") and compare its hash to the next 20 bytes, throwing away anything left.
Parse the 9th byte through the next "000000" as one piece of data. Then grab the next 19 bytes after that, and split that into 8 (toss 1) and 8. Then I do some other stuff that converts those two 8 byte strings into dates.
So that's the kind of thing I need to do.