I'm writing a little lexer for a simple calculator. Nothing fancy. I'm trying to learn, so I want to write it myself.
I have this pattern:
that will match the number inside the parenthesis of sin(xx), where x is any number, so "sin(2.3)" will give me this token: ["2.3"]
That would be great, except, my matcher also catches parentheses by these expressions:
So I end up with these tokens: ["(", "2.3", ")"] but I only want ["2.3"]
Is there a way to tell the matcher to skip the part of the string that is matched by another group?