[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



-- CHS

On Tue, 2004-10-26 at 18:53, Joe Steele wrote:
> > >
> > > [:alnum:]{1,8} * (PARAM)|(TABLE)|(UPDATE)  { return TOKEN_BLAH; }
> > >
> 
> I think this pattern needs another set of brackets [], like so:
> 
> [[:alnum:]]{1,8} * (PARAM)|(TABLE)|(UPDATE)  { return TOKEN_BLAH; }
> 
> Without the extra brackets, "[:alnum:]" has no special meaning, and 
> could just as well be "[na:mlu]".  In other words, it ends up 
> matching only on the letters "a", "l", "n", "u", "m", and ":".
> 
> Also, because the alternation operator "|" has the lowest precedence 
> in the pattern, I think this pattern is equivalent to (note the added 
> parentheses):
> 
> ([[:alnum:]]{1,8} * (PARAM))|(TABLE)|(UPDATE)
> 
> which is equivalent to:
> 
> (TABLE)|(UPDATE)|([[:alnum:]]{1,8} * (PARAM))
> 
> In other words, the expression ends up looking for an alphanumeric 
> token and a space before a "PARAM" token, but not before "TABLE" and 
> "UPDATE" tokens.  
> 
> --Joe
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
&gt; <a  rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale";>http://www.ale.org/mailman/listinfo/ale</a>


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00926" href="msg00926.html">[Fwd: Re: [ale] OT: Lex pattern expression struggles]</a></strong>
<ul><li><em>From:</em> joe at madewell.com (Joe Steele)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00969.html">[ale] mplayer and DVD's</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00971.html">[ale] Business opportunity...</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00926.html">[Fwd: Re: [ale] OT: Lex pattern expression struggles]</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00929.html">[ale] OT: Inter-Tel.</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00970"><strong>Date</strong></a></li>
<li><a href="threads.html#00970"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>