Hi,
the regular expression you need is this: (?!.*\b(\w+)\b\s+\1\b).*
try this out:
<h:form>
<h:inputText required="true" id="str" validatorMessage="error: string contains adjacent repeated words">
<f:validateRegex pattern="(?!.*\b(\w+)\b\s+\1\b).*" />
</h:inputText>
<h:message for="str"/>
<h:commandButton value="check" />
</h:form>
note: In the pattern attribute for validateRegex , i didn't escape the backslashes as you would do in the normal java code. If you escape, you wont get the desired results.See this for the backslash issue:
http://forums.sun.com/thread.jspa?threadID=5439029&tstart=-1
[Message sent by forum member 'nash_era']
http://forums.java.net/jive/thread.jspa?messageID=470828