"harijay" <harijay at gmail.com> wrote in message news:7424ff80-c645-4b30-b963-67997be29108 at j38g2000yqa.googlegroups.com... > I want to parse a number of strings and extract only those that > contain a 4 digit number anywhere inside a string Try: p = re.compile(r'\b\d{4}\b') -Mark