Forum Discussion
2 Replies
Sort By
I take it that you want to write the assertion in Groovy code?
If so, it's very easy to use regular expressions in Groovy. Assuming you have the value in the variable responseValue, the following expression will return true if and only if the value matches the regex [A-Z]+
responseValue ==~ /[A-Z]+/
Removing one character from the expression will give you a java.util.regex.Matcher object instead:
responseValue =~ /[A-Z]+/
The Matcher object is very useful for finding out more about the match, so you may want to read up on what you can do with it: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html.
Regards,
Manne, Ready! API Developer
- nmraoChampion Level 3May be you want to provide sample data where you got the trouble doing it?
Related Content
- 9 months agoLuukdb
- 9 years agoilovechiku
- 11 months agoclaudio
Recent Discussions
- 9 hours agoKay