I am curious about why "\w+|\s+" matches "Redinger" but fails to match "Matest Benger".
Solucionado! Ir para Solução.
@Biswarun, the reason your syntax only captures Redinger but not Matest Benger is due to your regex syntax \w+|\s+ it means that it will either capture a word or a space where or is represented by "|" (pipe).
In order to capture both the words, you can try this.
I hope this solves your doubt.
Thanks!
\w+ looks for the presence of one of more word characters, | indicates or and then \s+ indicates the presence of one or more spaces and so you’re asking it to return a string that is one or the other. In ‘Redinger’ there’s only word characters so that’ll return fine but the other string goes word > space > word and so you’d have to define the pattern in that order (something like \w+\s+\w+) instead of just saying the whole string is just one or the other.
That's nice but I am trying to match any generic string of the type "Word Word Word ...."
Test cases "Arnold Arn Besrf Degy" and "Asd Fgt Tghy Uigh Hjju" shall return true but "Arnol #$ Df" shall return false.
The regex mentioned by me, if run in global mode, can catch the entire string but I so not know how to enable such in Alteryx.
@grazitti_sapna I think you mean,
[a-zA-Z\s]+
Although with Case Insensitive ticked, you might as well just have,
[a-z\s]+