<div><div>It does appear to have a completely custom regex engine, so it could be an oversight. According to the code (as of R14B) you *can* use posix character classes like [:alnum:] and [:alpha:] though.</div><br><div class="gmail_quote">
2012/1/16 Ignas Vyšniauskas <span dir="ltr"><<a href="mailto:baliulia@gmail.com">baliulia@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Erlangers,<br>
<br>
why does xmerl_regexp not support the character class \w?<br>
<br>
1> {ok, MatchW} = xmerl_regexp:setup("\\w").<br>
{ok,{comp_regexp,{{{c_state,1,none,none,none,none,none,<br>
<..>}}}<br>
2> xmerl_regexp:match("a", MatchW).<br>
nomatch<br>
3> {ok, MatchW2} = xmerl_regexp:setup("[a-z]").<br>
{ok,{comp_regexp,{{{c_state,1,none,none,none,none,none,<br>
<..>}}}<br>
4> xmerl_regexp:match("a", MatchW2).<br>
{match,1,1}<br>
<br>
It supports \d for example:<br>
<br>
5> {ok, MatchD} = xmerl_regexp:setup("\\d").<br>
{ok,{comp_regexp,{{{c_state,1,none,none,none,none,none,<br>
<..>}}}<br>
6> xmerl_regexp:match("1", MatchD).<br>
{match,1,1}<br>
<br>
This causes XML validation to fail when I have the restriction in the<br>
schema <xsd:pattern value="\w{1,4}"/><br>
I get: {error, [{pattern_mismatch,"WORD","\\w{1,4}"}]}.<br>
<br>
Of course I can change the restriction to<br>
<xsd:pattern value="[A-Za-z0-9_]{1,4}"/><br>
but I wanted to make people aware of this issue.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Ignas<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</font></span></blockquote></div><br></div>