I have some regex values that I need to use as variables for a new regex.
I want to write something like:
val lowers: Regex = "[a-z]”.r
val uppers: Regex = "[A-Z]”.r
val letters: Regex = “(lowers | uppers)*”.r
But I don’t know the right syntax for it.
If it’s possible, how can it be done in Scala?
Edit
As suggested in the comments, this question is also related to this one when the regex variable is to be added outside the regex, which does not seem to be solving the problem here.