regex Flashcards
1
Q
what’s the standrad regex path ?
A
compile –> search –> group/start/end/span()
2
Q
what function will you use to obtain the matched regex strng (note this may not be the same as the regex expression, especially if regex expression is generic to refer to multiple strings)
A
group
3
Q
what function will you use to indicate the starting postion of the match?
A
start()
4
Q
what function will you use to indicate the ending position of the match?
A
end()
5
Q
how do you return both the starting and ending position using a tuple?
A
span
6
Q
how will you look for multiple matches?
A
compile –>finditer–>match –> group/start/end/span