<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">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?&nbsp;</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>'<a href="http://time.com/3073948/border-bill-republicians/'">http://time.com/3073948/border-bill-republicians/'</a>&nbsp;</div><div>allRegexMatches:&nbsp;</div><div>'\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: #'//[-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;&nbsp;[:alpha:] and then obviously chokes because it is not.&nbsp;</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>'<a href="http://time.com/3073948/border-bill-republicians/'">http://time.com/3073948/border-bill-republicians/'</a>&nbsp;</div><div>allRegexMatches:&nbsp;</div><div>'\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.&nbsp;</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.&nbsp;</div><div><br></div><div>Hopefully I’m the one who is dain bramaged.&nbsp;</div><div><br></div><div>Thanks in advance,</div><div><div apple-content-edited="true">
<table style="margin-top: 0.5em; margin-left: 0.5em; margin-bottom: 30px; position: static; z-index: auto;" border="0">
        <tbody><tr>
                <td colspan="2" style="padding-bottom: 0.3em; ">
                        <span style="font-family:'Trebuchet MS',helvetica,San-Serif;font-size:11px;color:#888888;line-height:22px"><b style="color:#11aeab;text-transform:uppercase;letter-spacing:2px">Aaron Rosenzweig</b>&nbsp;/&nbsp;<a href="http://www.chatnbike.com" title="visit Chat 'n Bike" style="text-decoration:none; border-bottom:1px dotted #888888;color:#888888">Chat 'n Bike</a></span><br>
                        <span style="font-family:'Trebuchet MS',helvetica,San-Serif;font-size:11px;color:#b2b2b2;"><b style="color:#888888">e:</b>&nbsp;&nbsp;<a href="mailto:aaron@chatnbike.com" title="email Aaron" style="text-decoration:none; border-bottom:1px dotted #b2b2b2;color:#b2b2b2">aaron@chatnbike.com</a>&nbsp;&nbsp;<b style="color:#888888">t:</b>&nbsp;&nbsp;(301) 956-2319</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 'n Bike" height="100">
                </td>
                <td>
                        <img src="http://www.chatnbike.com/WebObjects/FamilyCycleGroupOrder.woa/Contents/WebServerResources/images/dealers/usa.jpg" alt="Chat 'n Bike" height="100">
                </td>
        </tr>
</tbody></table>

</div>
<br></div></body></html>