1. Home
  2. Computing & Technology
  3. Python

Python Regular Expression Examples: Escaped D ('\D')

From , former About.com Guide

Definition:
>>> import re
>>> english = '"Never increase, beyond what is necessary, the number of entities required to explain anything." -- William of Ockham (1285-1349)'
>>> print re.findall(r'\D', english)
['"', 'N', 'e', 'v', 'e', 'r', ' ', 'i', 'n', 'c', 'r', 'e', 'a', 's', 'e', ',', ' ', 'b', 'e', 'y', 'o', 'n', 'd', ' ', 'w', 'h', 'a', 't', ' ', 'i', 's', ' ', 'n', 'e', 'c', 'e', 's', 's', 'a', 'r', 'y', ',', ' ', 't', 'h', 'e', ' ', 'n', 'u', 'm', 'b', 'e', 'r', ' ', 'o', 'f', ' ', 'e', 'n', 't', 'i', 't', 'i', 'e', 's', ' ', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', ' ', 't', 'o', ' ', 'e', 'x', 'p', 'l', 'a', 'i', 'n', ' ', 'a', 'n', 'y', 't', 'h', 'i', 'n', 'g', '.', '"', ' ', '-', '-', ' ', 'W', 'i', 'l', 'l', 'i', 'a', 'm', ' ', 'o', 'f', ' ', 'O', 'c', 'k', 'h', 'a', 'm', ' ', '(', '-', ')']

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. Escape Sequences
  7. Python RegEx - Python Regular Expressions - Examples - Escaped A ('\D')

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

All rights reserved.