Jan 23, 2012, 1:52 AM
Post #7 of 8
In your case, no. Aside from the fact that the brackets are unnecessary ([\D] can be simply written as \D), the asterisk doesn't make sense. \D* means: "zero or no non-digits". Hence it matches ANY zero-length part of your string - certainly not what you have in mind.
Re: [saurabhsharma] Replacing exact match of IP from list of files
[In reply to]
You could write \D+, but since you don't collect the non-digits, this doesn't bring any advantage over just writing \D.
You should, however, conisder the case, whether the pattern you are looking for, could also appear at the *start* of the string. In this case, you would need something like (^|\D).