Trying to use a jflap regex in scala
Pls see the following DFA http://i.stack.imgur.com/iH3RM.png
created via JFLAP. When I convert to regex, JFLAP gives:
When I paste it in the Scala REPL :
scala> val regex = "p+(q+pq)(pq)*(+p)".r java.util.regex.PatternSyntaxException: Dangling meta character '+' near index 14 p+(q+pq)(pq)*(+p) ^ at java.util.regex.Pattern.error(Unknown Source)
I have two simple questions.
Is that the right regex ? Why does it include a λ ?
How do I use it in Scala since the λ doesn't show up correctly when I paste in repl ?
In formal regular expression notation + means "or". The regex you want to use is something like: