I was learning about regex and found out that +
and the {1,}
have the same function. What I was wondering is whether there is any difference between the two?
I tried finding out the execution times by copying a standard passage and executing the regex patterns using the above two operators. I found out that the execution time for {1,}
was faster than that of +
. Can anyone explain why?
pattern1 = r'/[A-Z]{1,}/g'
pattern2 = r'/[A-Z]+/g'