News for hackers. Stuff that matters.
Re:Is there a regular expression to detect a valid regular e... by jessaustin on Sunday September 08, 2019 @10:11PM (#20914671)
You could have a stack of (paren-type, integer) pairs. If the paren has a different type than the top pair on the stack (or the stack is empty), push a new pair with the integer set to one. If the integer goes to zero, pop the pair. At the end of the expression, you have to have an empty stack.

There are no comments on this comment yet.