Forum Discussion
- LucianCommunity HeroI don't fully understand. What are you trying to achieve? Usually you use regex for assertions. I don't get how you would be able to use it as input.
- richieCommunity Hero
Hi joanna
I've never tried it myself but just an additional comment to Lucian's.
If you consider the syntax you use in a regex pattern - specifically the reserved chars in a regex pattern that can ALSO occur in an input parm - e.g. curly braces, normal bracket characters and $ character - unless you have a way to escape these (and I don't mean html encoding sort of escape - cos I've tried this previously and that doesn't work for input parms) then I don't see how you would achieve this.
There's probably further implications that I haven't considered - but thats the big one that jumps out at me
Sorry I couldn't be of more help,
Cheers,
richie
- aaronpliuFrequent Contributor
it's possible. But not sure what your requirement is.
if you wanna input parameter with code in payload of POST, then you would use like below
// assume that a value is true or false according to your input // assume 'a123' is your dynamical input below // below value will be true ${=java.util.regex.Pattern.matches('(a|b)[0-9]+','a123')}
Hopefully it is an example for you to figure out what you required.
Thanks,
Aaron
- aaronpliuFrequent Contributor
it's possible. But not sure what your requirement is.
if you wanna input parameter with code in payload of POST, then you would use like below
// assume that a value is true or false according to your input
// assume 'a123' is your dynamical input below
// below value will be true
${=java.util.regex.Pattern.matches('(a|b)[0-9]+','a123')}Hopefully it is an example for you to figure out what you required.
Thanks,
Aaron
Related Content
- 3 years ago
- 11 years ago
Recent Discussions
- 4 hours ago
- 17 days ago