Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR ASSEMBLY

regex find a word index of all matches

import re
sentence = input("Give me a sentence ")
word = input("What word would you like to find ")
for match in re.finditer(word, sentence):
    print (match.start(), match.end())
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #regex #find #word #index #matches
ADD COMMENT
Topic
Name
1+6 =