in reply to Matching (non)spaces in regex?

The behavior you're describing certainly sounds weird to me. I suspect it's your [^\d] and [^ ] groups, which are goofy. I changed them as described below and your regular expression worked great for me.

Note that items like \d and [ ] (perhaps illegal, but I know what you're doing and this is equivalent to \s) have opposites: \D (non-digits) and \S (non-spaces).

In your case here, your regular expression could be better written like:

/(\d+\S+)\D+(\d+): (.*)$/
Perhaps someone else has a better optimization, but this will essentially start your search on the first number, continue for the rest of that "field", and then match non-numbers until it gets your 2nd numeric, following up with everything else in $3. Modify to taste.

You may also want to consider using split to break your line up into fields separated by spaces. The only processing you'd have to do at that point is to get rid of the colon following your last numeric.

Note: Code samples are for conceptual use only and generally are not meant to be cut/pasted into a production application. Always 'use strict', have a thorough understanding of the code you use, and check the return values of functions and handle errors according to your needs. - Fastolfe