Search code examples
regexsemanticsformal-languages

Regular Expression: Mathematically vs. Programmatically


Consider the following regular expressions:

  1. 7+
  2. (7)+

Does anyone that is very familiar with regular expression theory in Mathematics agree that the two regular expressions are semantically the same?


Solution

  • Yes, those two regular expressions are the same because they both recognize the same language. The fact that they are not written identically is just a notational issue.