

I cannot hard code this whitespace character in my tests. With that in mind, How do I account for this? I need to pass in different values on the fly i.e. This character is obviously being produced by the AUT. A screenshot of notepad++ revealing this is attached.

At first there was not, however when I changed the character encoding from ANSI to UTF-8, notepad++ revealed this wierd whitespace character inbetween 'Next' and 'Week'. Some regex characters provide a repetition factor, called a 'multiplier'. Anchors belong to the family of regex tokens that dont match any characters. To find out, I popped them both in notepad++ and used the 'Show All Characters' button (the one that reveals carriage return and whitespace characters) to see if there was any difference. s any whitespace character S any non-whitespace character d any decimal digit D any character EXCEPT a decimal digit Multipliers. Notepad++ is a free (as in free speech and also as in free beer). Why were these seemingly identical RanoreXpaths yielding different results? This therefore produces the exact same RanoreXpath as the one shown above. when I use the Spy tool to bring up the available values for the innertext attribute of the div I am looking for, the value 'Next Week' appears. If you have any leading whitespace the string will be unchanged.Problem is, an exception is thrown because this RanoreXpath yields no results. Note that these all require that there be non-whitespace at the front of the line for the expression to match. If alphanumeric are allowed, and underscores aren't a problem, you could also do In your original question you said "text and numbers", by which I take it you mean alphanumeric (unless symbols are allowed - is "not-just-alphanumunder" legitimate?). If you want to strip any and all leading spaces that remain after removing the non-spaces, your matching pattern might be one of "\s" is a special token matching whitespace, "\S" is a special token matching all not-whitespace characters. // s stands for white space // says the preceding character may occur once or not occur. If you use that in your regular expression it will leave any spaces remaining at the start of the string. Will match all non-whitespace characters at the start of the string (which will include tabs, but I don't see how you would get a tab in your data).
