|
|
Re: Is it possible to escape parameters/variables included in a regex? [message #1081723 is a reply to message #1080735] |
Wed, 07 August 2013 15:53 |
David Hickernell Messages: 85 Registered: October 2012 |
Member |
|
|
Well, here's the general situation. Test case A has a parameter, LANGUAGE, and test case A executes test case B, which requires a regular expression string. I want to include =LANGUAGE in the RE, but one of the possible values for LANGUAGE is "C++". This produces an error when included in the RE. However, if I put quotes around =LANGUAGE in the RE, then instead of including the literal contents of parameter LANGUAGE, the RE string will simply include the literal string "=LANGUAGE".
So what I wanted was for the RE to contain =LANGUAGE in such a way that the contents of LANGUAGE are taken literally in the RE. What I am now doing as a workaround is just defining another column of data, LANGUAGE_ESC, that contains escaped versions of the LANGUAGE values, and using =LANGUAGE_ESC in the RE instead. I was curious if there was a simpler way to do it.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03897 seconds