1. Home
  2. Computing & Technology
  3. Python

Python Regular Expression Examples: the Plus Sign

From , former About.com Guide

Definition:
>>> import re
>>> list = ['cat', 'car', 'cap', 'cab', 'cad', 'can', 'Cancun', 'Katze', 'Auto', 'Deckel', 'Droschke', 'Flegel', 'Dose', 'Vogel', 'CHAT', 'VOITURE', 'CHAPEAU', 'CABINE', 'DAO', 'BIDON', 'BONBON']
>>> y = re.compile('.*E$')
>>> for x in list:
...     if y.match(x):
...             print x
VOITURE
CABINE
>>> y = re.compile('.*E.+$')
>>> for x in list:
...     if y.match(x):
...             print x
CHAPEAU

Back to the main index of this glossary
Explore Python
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Python
  4. Regular Expressions
  5. Python RegEx Examples
  6. Python RegEx - Python Regular Expressions - Examples - the Plus Sign

©2009 About.com, a part of The New York Times Company.

All rights reserved.