This is the P2PU Archive. If you want the current site, go to www.p2pu.org!
In computing, a regular expression, also referred to as regex or regexp, provides a concise and flexible means for matching strings of text, such as particular characters, words, or patterns of characters.
The following examples illustrate a few specifications that could be expressed in a regular expression:
Source: Wikipedia
Python regular expression syntax follows in the Perl lineage. The Python module re provides regular expression functionality. Regular Expressions are a sub-language embedded within the larger Python language.
Python.org
Please post regex excercises and questions below. We can help each other learn and explore this robust and slightly difficult aspect of Python.
Comments
Chapter 11 stuff up at:
Chapter 11 stuff up at: https://github.com/thcipriani/thcipriani.github.com/blob/master/python10...
Exercises chapter 11:
Exercises chapter 11: http://www.pastie.org/2021643
The average I found for exercise 11.2 using mbox.txt was 38549.7949721
Chapter 11 Exercises:
Chapter 11 Exercises: https://github.com/jwmnatl/jwmnatl.github.com/blob/master/python101/chap...
For Ex. 11.2, my average for mbox.txt was 39607.
I received smaller number of lines than those referenced in Ex. 11.1 :
e.g. -
Enter a regular expression: ^Author
mbox.txt had 339 lines that matched ^Author
Enter a regular expression: ^X-
mbox.txt had 2715 lines that matched ^X-
Enter a regular expression: java$
mbox.txt had 510 lines that matched java$
Chap
Chap 11
http://www.pastie.org/2066794