I am trying to validate a string (containg numbers, alphabets and spaces in between words and also contains trailing and leading white spaces) .I need a regular expression which i can put in response assertion of jmeter
Asked
Active
Viewed 353 times
-1
-
asked before http://stackoverflow.com/questions/7967075/regex-for-not-empty-and-not-whitespace you can use /^$|\s+/ in regular expression – Ori Marko May 04 '17 at 06:47
1 Answers
0
Standard recommendation not to use regular expressions for working with HTML and/or XML.
Go for XPath Assertion instead, using it you can implement your requirement using XPath query like:
//yourElement[@yourTag!='null' and not(contains(@yourTag,' '))]
XPath language is quite easy, at least it is much easier to create and read XPath expressions rather than "regular" ones. Check out XPath Tutorial to get started and How to Use JMeter Assertions in Three Easy Steps guide to learn more about assertions available in JMeter.