Skip to content

Commit 31cdb3e

Browse files
files
1 parent 7ed8d24 commit 31cdb3e

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
will update shortly
1+
import re
2+
3+
S = input()
4+
k = input()
5+
6+
pattern = re.compile(k)
7+
r = pattern.search(S)
8+
9+
if not r:
10+
print("(-1, -1)")
11+
12+
while r:
13+
print("({}, {})".format(r.start(), r.end() - 1))
14+
r = pattern.search(S,r.start() + 1)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import re
2+
3+
S = input()
4+
k = input()
5+
6+
pattern = re.compile(k)
7+
r = pattern.search(S)
8+
9+
if not r:
10+
print("(-1, -1)")
11+
12+
while r:
13+
print("({}, {})".format(r.start(), r.end() - 1))
14+
r = pattern.search(S,r.start() + 1)

0 commit comments

Comments
 (0)