automatafinite-automata

what is the meaning of {} in the regular expressions {a + ab}*


I wonder what is the meaning of curly brackets{} in the regular expressions {a + ab}* and how are they different from the round brackets() in regular expressions.


Solution

  • If this is regarding the syntax of theoretical regular expressions, curly braces are not part of the usual definitions I have seen which only include parentheses. However, I imagine that they serve the same purpose and are probably used by analogy since every regular expression and subexpression is related to a language (a set of strings) and curly braces are usually used to denote sets. In the same way, you sometimes see people using U (union) or | (logical or) instead of + in regular expressions to mean the same thing.

    In short, {a + ab}* almost surely means the same thing as (a + ab)*.