Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python RegEx Getting index of matched object

import re
 
s = "Welcome to Softhunt"
 
# here x is the match object
res = re.search(r"S", s)
 
print(res.start())
print(res.end())
print(res.span())
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Python #RegEx #Getting #index #matched #object
ADD COMMENT
Topic
Name
6+2 =