I would like to create a function that creates regex matching an arbitrary string given at the input. For example, when I feed it with 123$ it should match lite
123$
Just to bring more attention to Harold L's comment above, if you want to do this with a Scala library you can use:
import scala.util.matching.Regex Regex.quote("123$").r.findFirstIn("123$")