Search code examples
regexregular-language

Regular expression problem


What is the regular expression for the language 0m1n where m+n is even?


Solution

  • If you mean a string 000...111... where the length of the string is even, you can use ^(00)*(01)?(11)*$