I'm working on 2 cases:
assume I have those var:
a = "hello"
b = "hello-SP"
c = "not_hello"
Any partial matches
I want to accept any string that has the variablea
inside, sob
andc
would match.Patterned match
I want to match a string that hasa
inside, followed by'-'
, sob
would match,c
does not.
I am having problem, because I always used the syntax /expression/
to define Regexp, so how dynamically define an RegExp on Ruby?