![]() |
Remembering why I hate Regex
Well, I'm trying to do a quick regex match here, and it won't stop choking. The strings are formatted as:
I am trying to skip the initial text, if any, and find that middle number before the comma. Unfortunately it keeps dying. The center number can reach from 1-3 digits in length. I've tried patterns based off this: PHP Code:
I hope someone around here can remind me how to do it right... *!* |
Would the following be OK?
php Code:
|
Yeah, thanks. That helps a lot. Found around 2-3 different errors in that section total. Now I'm just working on a switch statement that isn't working.
|
You've already got the problem solved but I see no reason to waste time and energy when it's not necessary. Is there any reason why the following would not suffice?
PHP Code:
|
Methinks that would work a bit faster, without the string match. Thanks Salathe. :-)
|
| All times are GMT. The time now is 08:10 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0