in reply to Matching numbers by regex.

As others have noted, the greediness of .* is your problem. However, they all seem to want to fix it by making it not match any digits, which seems odd, since the problem isn't that it can match digits, but rather that it is greedy. I would just change .* to .*? to make it non-greedy. The results will be just about the same in this particular instance, however.


Sanity? Oh, yeah, I've got all kinds of sanity. In fact, I've developed whole new kinds of sanity. Why, I've got so much sanity it's driving me crazy.