mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +09:00
14 lines
207 B
Python
14 lines
207 B
Python
|
|
import re
|
|
|
|
haystack = "Hello world"
|
|
needle = 'ello'
|
|
|
|
mo = re.search(needle, haystack)
|
|
print(mo)
|
|
|
|
# Does not work on python 3.6:
|
|
# assert isinstance(mo, re.Match)
|
|
assert mo.start() == 1
|
|
assert mo.end() == 5
|