Hi
I have a query regarding functioning of doSwitch.
I have a certain value with regard to which I want to take 2 actions depending on the pattern that value returns.
doSwitch("${myKey}")(
key1 → chain1,
key2 → chain2
)
e.g. myKey will hold a alphabetical value → abc or numerical value-> 542
And I want my keys to basically match that pattern. But doSwitch is not evaluating the regex
My Code →
doSwitch("${myKey}")(
“”"[a-z]+""".r → chain1,
“”"[0-9]+""".r → chain2
)
This is not working . But if I write the exact values as:
doSwitch("${myKey}")(
“”“abc”"" → chain1,
“”“542"”" → chain2
)
The code works.
Can anyone help me here?