<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 15.06.18 19:39, René J.V. Bertin
wrote:<br>
</div>
<blockquote type="cite" cite="mid:1763497.OnyHy8PNsM@portia.local">
<pre class="moz-quote-pre" wrap="">Is there a way to write a single glob regexp that expands to all lib*.dylib EXCLUDING lib*.[0-9]*.dylib, lib*.[0-9]*.[0-9]*.dylib, etc? I think the excluded list could be obtained by lib*.[0-9.]*.dylib (assuming the dot isn't a wildcard here), is there a better way to get at the list I want than to do 2 globs and then a list exclusion operation?
</pre>
</blockquote>
<p>with tcl 8.6, one can do the following<br>
</p>
<pre> set excludePattern {lib*.[0-9]*.dylib}
set files [glob -tails -dir /opt/local/lib *.dylib]
set excludedFiles [lmap f $files {if {[regexp $excludePattern $f]} continue; set f}]
The exclude pattern can contains certainly "|" for alternate exclude patterns, etc.
all the best
-gn
</pre>
<pre class="moz-signature" cols="72">
</pre>
</body>
</html>