Introduction to Python - Part 2
Introduction to Python Part 2
COMPSCI 260 1 September 2014
Part 2 Topics:
? Regular expressions (and the re package) ? Python code reuse, modules, and import ? File I/O ? range() function ? Multidimensional arrays ? Some useful Python modules ? Quick note on debugging ? Other resources
Regular Expressions (Regex)
? Useful for finding matches to patterned
strings.
?
Regular Expressions in Python
? Make sure you import the module "re".
Method
Purpose
sub() search()
match() findall() finditer()
Search and replace the matched substring with a new string
Scan through a string, looking for any location where this RE matches.
Determine if the RE matches at the beginning of the string.
Find all substrings where the RE matches, and returns them as a list.
Find all substrings where the RE matches, and returns them as an iterator.
Regular Expressions in Python
?MatchObject methods (used with match or
search).
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- tfm volume 1 part 2 chapter 4700
- riddle part 2 crossword clue
- exam 2 introduction to sociology
- ielts speaking part 2 pdf
- ielts speaking part 2 and 3 questions
- ielts speaking part 2 education
- ielts speaking part 2 art
- ielts speaking part 2 3
- ielts speaking part 2 structure
- ielts speaking part 2 answers
- ielts writing part 2 questions
- introduction to python pdf