<div class="gmail_quote">On Wed, Feb 24, 2010 at 3:34 PM, Matt Riddell <span dir="ltr"><<a href="mailto:lists@venturevoip.com" target="_blank">lists@venturevoip.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>On 24/02/10 1:10 AM, Nick Lewis wrote:<br>
> For example using ~ as a wildcard to mean "zero or more times last char"<br>
> it would be possible to limit trailing chars to numeric, alphanumeric or<br>
> almost anything<br>
><br>
> _123[0-9]~<br>
> _123[0-9a-zA-Z]~<br>
> _123[!-~]~<br>
<br>
<br>
</div>Agree.<br>
<br>
It would also mean you could do a search and replace for _X. to _X~<br>
<br></blockquote><div><br>OK, a final '~' meaning 0 or more of the preceding character or class. Hmmm.<br>Instead, would it be OK to make it 1 or more (this seems easier, as no existing<br>pattern char can stand for null input).<br>
<br>I <font size="4"><b>don't</b></font> think it would be good to allow it in the middle, eg, "_XX8~XX",<br>because then you get into some sticky recursion trying to determine<br>if stuff like "12888" is a match or not, as you might be tempted to absorb all the 8's<br>
and not leave a couple for the end of the pattern. You then back up and try other paths,<br>and that's where things get complicated. And, then you can have more than one ~ in<br>the pattern, and wow, you'd need rules to disambiguate.<br>
<br>But restricted to being at the end of a pattern, that's easier to implement.<br><br>If I can budget a little time, I might actually code this up in the new pattern<br>matcher.<br><br>murf<br><br></div>-- <br></div>
Steve Murphy<br>ParseTree Corp<br><br>