<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
Thanks, but...I just tested this and if you set, say, the config
permission using the regex in the example:<br>
<br>
<span class="code ">^amq\.gen.*|amq\.default$<br>
<br>
it will allow me to create a queue, for example, with the name:<br>
<br>
testamq.default<br>
<br>
</span><span class="code ">so it is clearly not equivalent to </span><br>
'^(amq\.gen.*|amq\.default)$'<br>
<br>
which does <i>not</i> allow me to create the above queue.<br>
<br>
Again, although granting someone permission as in that particular
doc example is unlikely to accidentally grant permission since the
entity would have to be named <something>amq.default, it is
still a misleading example to give to people who might use that
pattern to form other more dangerously permissive regex's, under the
false assumption that later alternations are anchored at the
beginning.<br>
<br>
<span class="code "><br>
</span><br>
<div class="moz-cite-prefix">On 03/18/2013 12:04 PM, Emile Joubert
wrote:<br>
</div>
<blockquote cite="mid:51474905.7010903@rabbitmq.com" type="cite">
<pre wrap="">
Hi James,
On 18/03/13 16:22, James Gardner wrote:
</pre>
<blockquote type="cite">
<pre wrap="">In the RabbitMQ.com documentation, under Access Control, paragraph six,
it gives this as an example of a regex:
'^amq\.gen.*|amq\.default$'
</pre>
</blockquote>
<pre wrap="">
The regular expression syntax and semantics available in RabbitMQ
resemble those of Perl and is based on PCRE. In that flavour of RE the
example is correct - the alternate options are all subject to the
anchors while matching.
</pre>
<blockquote type="cite">
<pre wrap="">Shouldn't it be
'^(amq\.gen.*|amq\.default)$'
</pre>
</blockquote>
<pre wrap="">
The expression is already equivalent to this one.
-Emile
</pre>
</blockquote>
<br>
</body>
</html>