On Nov 9, 6:29 am, Prabhu Gurumurthy <[EMAIL PROTECTED]> wrote: ... > regex: I presume this is rather a dumb question, anyways here it comes! as you > can see from my program, pattIp = r\d{1,3}\.... etc, is there any other easy > way > to group the reptitions, instead of typing the same regex 4 times. ... > pattIp = r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'
pattIp = r"\d{1,3}(\.\d{1,3}){3}" Is the best you can get using pure regexes (rather than something like Paul's solution). -- http://mail.python.org/mailman/listinfo/python-list