Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14d53bf commit dff8404Copy full SHA for dff8404
2 files changed
Lib/grep.py
@@ -4,14 +4,14 @@
4
import string
5
6
def grep(expr, filename):
7
- prog = regexp.compile(expr)
+ match = regexp.compile(expr).match
8
fp = open(filename, 'r')
9
lineno = 0
10
while 1:
11
line = fp.readline()
12
if not line: break
13
lineno = lineno + 1
14
- res = prog.exec(line)
+ res = match(line)
15
if res:
16
#print res
17
start, end = res[0]
Lib/lib-old/grep.py
0 commit comments