Thanks! So what i would need to have is '.' after a '/' or beginning of string followed by anything BUT a '/', right?<br><br><div class="gmail_quote">On Mon, May 28, 2012 at 12:19 PM, John Johansen <span dir="ltr"><<a href="mailto:john.johansen@canonical.com" target="_blank">john.johansen@canonical.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 05/28/2012 09:23 AM, Nicolas Valcárcel wrote:<br>
> Hi, i'm working on rewriting to python3 some apparmor tools, but i'm not a perl expert, nor know apparmor in deep, so i got a stopper here that i hope you can help me with.<br>
><br>
</div>hey Nicolas<br>
<div class="im"><br>
> In Immunix/AppArmor.pm there is a function isSkippableFile which has a regexp i don't understand:<br>
> $path =~ /(^|\/)\.[^\/]*$/ <--- this one i don't understand<br>
</div>dot files, but looking at it, it has an issue<br>
'.' followed by anything that is not a path<br>
or<br>
'/.' followed by anything that is not a path, note the leading '/' is not anchored<br>
<br>
so<br>
<br>
.<br>
..<br>
.foo<br>
/.<br>
/..<br>
/.foo<br>
bar/.foo<br>
/bar/.foo<br>
<br>
but not<br>
<br>
./<br>
.foo/<br>
.foo/bar<br>
/.foo/<br>
/.foo/bar<br>
<br>
now for where it has a problem, since the leading '/' is unanchored<br>
/.foo/.bar<br>
<br>
will match<br>
<div class="im"><br>
<br>
> $path =~ /\.rpm(save|new)$/ <--- this would be anything ending in .rpmsave or .rpmnew?<br>
</div>yes<br>
<div class="im"><br>
> $path =~ /\.dpkg-(old|new)$/ <--- this would be anything ending in .dpkg-old or .dpkg-new?<br>
</div>yes<br>
<div class="im"><br>
> $path =~ /\.swp$/ <--- this would be anything ending in .swp?<br>
</div>yes<br>
<div class="im"><br>
> $path =~ /\~$/); <--- this would be anything ending in ~?<br>
><br>
</div>yes<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Nicolas Valcárcel</div><div>Gerente IT / CTO</div><div>Celular: (511) 976 330 707</div><br>