Forum Discussion

mike_korcynski's avatar
mike_korcynski
New Contributor III
8 years ago
Solved

Substitute variable in regex expression

I have a mapper with json input like this: $effective_code = “2138-HCOM-0546-01” $course_code =“2138-HCOM-0546-01-12345|2138-HCOM-0546-EMR-12456” I want an expression that will match “2138-HCOM...
  • tstack's avatar
    8 years ago

    The argument to match() takes a string that will be interpreted as a regular expression. So, you should be able to do:

    $COURSE_CODE.match($effective_code + "-\\d{5,}")