Answers for "regex search for all math operators"

0

regex search for all math operators

[*+\/-]+|[A-Za-z]+

This will works. According to @CertainPerformance The performance of that 
should be fine. The problem is always when several branches of alternation 
start with matching the same content (like a*|aa*, for example). There is no 
possibility your two branches will ever both match on the same character, 
so that is as good as regex gets.

Also, thanks for your answer @revo.
Posted by: Guest on April-20-2021

Browse Popular Code Answers by Language