Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to match proxy patterns using the following regex:


It is working well thus far, but is not matching the following:

Any ideas? Thanks!

share|improve this question
Could you please provide some examples of text that is working well? Also, it would help to know which regex tool or language you are using, in case it's simply not supporting (?: ... ) or {n} notation as expected. – Bradd Szonye Apr 12 '13 at 21:33

This match in python regex

>>> import re
>>> ip = ''
>>> match = re.match(r'((?:\d{1,3}\.){3}\d{1,3}):(\d+)', ip)
>>> print match
<_sre.SRE_Match object at 0xb755da88>

Could be:

share|improve this answer
Thanks man.. this worked. – acamso Apr 12 '13 at 20:52
Nice, so you should accept answer :) – maxxvw Apr 13 '13 at 20:14

Drop the leading ':' or change it to ':?'. your reference string does not start with a : nor does a colon appear before the numeric expression.

share|improve this answer
The (?: ... ) clustering notation does not match literal characters, but simply allows for subexpressions without capturing back-references. – Bradd Szonye Apr 12 '13 at 21:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.