<div dir="ltr"><div>This worked for me...<br><br>&#39;<a href="http://time.com/3073948/border-bill-republicians/">http://time.com/3073948/border-bill-republicians/</a>&#39; <br>allRegexMatches: &#39;\b(https?|ftp|file)[:]//[-a-zA-Z0-9+&amp;@#/%?=~_|!:,.;]*[a-zA-Z0-9+&amp;@#/%=~_|]&#39;<br>
<br></div><div>Just add [] around : and included lowercase a-z<br></div><div><br></div><div>For your reference<br></div><div><br></div>Cincom VW7.9 <br>RxParser class side method #c:_ syntax:__ <br><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Aug 3, 2014 at 11:53 PM, Aaron Rosenzweig <span dir="ltr">&lt;<a href="mailto:aaron@chatnbike.com" target="_blank">aaron@chatnbike.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Hi,<div><br></div><div>Is there anything newbies should know about Vassili Bykov’s RxParser? It is the de-facto tool for parsing regular expressions in Smalltalk correct? </div><div><br></div>
<div>Even the “String” class has a utility method that uses it.</div><div><br></div><div>Strange for it to be the de-facto standard because… it feels limiting -&gt; see below:</div><div><br></div><div>I’m trying to “detect” a url so in this example:</div>
<div><br></div><div>&#39;<a href="http://time.com/3073948/border-bill-republicians/&#39;" target="_blank">http://time.com/3073948/border-bill-republicians/&#39;</a> </div><div>allRegexMatches: </div><div>&#39;\b(https?|ftp|file)://[-A-Z0-9+&amp;@#/%?=~_|!:,.;]*[A-Z0-9+&amp;@#/%=~_|]’</div>
<div><br></div><div>I believe it should work. On my Mac, using “RegExRX” I tested that the expression itself is ok.</div><div><br></div><div>In Pharo I get “RegexMatchingError: invalid predicate selector”</div><div><br></div>
<div>When I debug into it a bit more I see:</div><div><br></div><div>Character(Object)&gt;&gt;doesNotUnderstand: #&#39;//[-A-Z0-9+&amp;@#/%?=~_|!’</div><div><br></div><div>I *assume* it is having trouble with the colons. There is a colon after the “http” part and then one in the first set of []* part right after the exclamation mark… it’s almost like it wants to treat it as if it was one of the convenience constructs like -&gt; [:alpha:] and then obviously chokes because it is not. </div>
<div><br></div><div>doh! Has anyone run into this before?</div><div><br></div><div>…..</div><div><br></div><div>*Assuming* that we have to escape every colon when we use the RxParser I modified the code to look like this:</div>
<div><br></div><div>&#39;<a href="http://time.com/3073948/border-bill-republicians/&#39;" target="_blank">http://time.com/3073948/border-bill-republicians/&#39;</a> </div><div>allRegexMatches: </div><div>&#39;\b(https?|ftp|file)\://([-A-Z0-9+&amp;@#/%?=~_|!,.;]|\:)*[A-Z0-9+&amp;@#/%=~_|]’</div>
<div><br></div><div>I tested this in RegExRX and it is fine… but in Pharo I at least don’t get an error but I also don’t get any results! Just an empty OrderedCollection. </div><div><br></div><div>Does anyone have any suggestions or am I out of luck? Do I need a different regular expression tool for Smalltalk besides RxParser? Hopefully I’m just making a simple mistake. </div>
<div><br></div><div>Hopefully I’m the one who is dain bramaged. </div><div><br></div><div>Thanks in advance,</div><div><div>
<table style="margin-top:0.5em;margin-left:0.5em;margin-bottom:30px" border="0">
        <tbody><tr>
                <td colspan="2" style="padding-bottom:0.3em">
                        <span style="font-family:&#39;Trebuchet MS&#39;,helvetica,San-Serif;font-size:11px;color:#888888;line-height:22px"><b style="color:#11aeab;text-transform:uppercase;letter-spacing:2px">Aaron Rosenzweig</b> / <a href="http://www.chatnbike.com" title="visit Chat &#39;n Bike" style="text-decoration:none;border-bottom:1px dotted #888888;color:#888888" target="_blank">Chat &#39;n Bike</a></span><br>

                        <span style="font-family:&#39;Trebuchet MS&#39;,helvetica,San-Serif;font-size:11px;color:#b2b2b2"><b style="color:#888888">e:</b>  <a href="mailto:aaron@chatnbike.com" title="email Aaron" style="text-decoration:none;border-bottom:1px dotted #b2b2b2;color:#b2b2b2" target="_blank">aaron@chatnbike.com</a>  <b style="color:#888888">t:</b>  <a href="tel:%28301%29%20956-2319" value="+13019562319" target="_blank">(301) 956-2319</a></span>
                </td>
        </tr>
        <tr>
                <td>
                        <img src="http://www.chatnbike.com/WebObjects/FamilyCycleGroupOrder.woa/Contents/WebServerResources/images/chat_n_bike_logo_small.png" alt="Chat &#39;n Bike" height="100">
                </td>
                <td>
                        <img src="http://www.chatnbike.com/WebObjects/FamilyCycleGroupOrder.woa/Contents/WebServerResources/images/dealers/usa.jpg" alt="Chat &#39;n Bike" height="100">
                </td>
        </tr>
</tbody></table>

</div>
<br></div></div></blockquote></div><br></div>