Using ^^ in Scala Parser Combinators

When I am tring to use the

.r ^^ {....} syntax an error crops up saying :

value ^^ is not a member of scala.util.matching.Regex

I have already included

libraryDependencies += “org.scala-lang.modules” %% “scala-parser-combinators” % “1.1.2”

in the build.sbt file.

What could be the problem please ?

Thanks a lot and good day :slight_smile:

You forgot to import some implicit conversion, which creates a Parser[String] from a Regex.

See here https://javadoc.io/static/org.scala-lang.modules/scala-parser-combinators_2.12/1.2.0-M1/scala/util/parsing/combinator/RegexParsers.html

Otherwise, show your code.

1 Like

Thanks a lot for your help. :slight_smile:

Problem solved, without the need of making use of the Regexes

Thanks a lot and good day :slight_smile: