<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Hi Nicolas,</p>
<p><br>
</p>
<p>Does this work for you? #copyReplaceAll:with: appears not to accept regexes.</p>
<p>For example, consider this output:</p>
<p><span><b>'123' copyReplaceAll: '\d' with: 'x'. "'123'"</b></span><br>
</p>
<p><span><br>
</span></p>
<p><span>On my machine, the following does not work:</span></p>
<p><span><img size="9529" id="x_img290284" tabindex="0" style="max-width:99.9%" src="cid:e490ef14-7d7b-419e-997f-dbfee712f2d2"><br>
</span></p>
<p><span>I selected everything and pressed <cmd>m. I would rather expect to be notified that there are not implementors of #foo:?</span></p>
<p><span><br>
</span></p>
<p><span>(By the way, see also the discussion <a href="http://forum.world.st/The-Inbox-Collections-ct-885-mcz-td5114711.html" class="x_OWAAutoLink">
in this thread</a>. #copyReplaceAll:with: and #copyWithRegex:matchesReplacedWith: is another pair of similar-featured methods that maybe could be merged if we created a common protocol for comparison and matching ...)</span></p>
<p><span><br>
</span></p>
<p><span>Best,</span></p>
<p><span>Christoph</span></p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org><br>
<b>Gesendet:</b> Samstag, 9. Mai 2020 18:27:53<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Trunk: Collections-nice.891.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Nicolas Cellier uploaded a new version of Collections to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Collections-nice.891.mcz">http://source.squeak.org/trunk/Collections-nice.891.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Collections-nice.891<br>
Author: nice<br>
Time: 9 May 2020, 6:27:51.164977 pm<br>
UUID: 4b4cd1ee-3b62-4ee2-b819-5b4481f6ecee<br>
Ancestors: Collections-nice.890<br>
<br>
Find a selector in a line containing an assignment<br>
<br>
This uses new (negative) lookahead extensions to Regex (hence requires Regex >= Regex-Core-ct.56).<br>
<br>
Example: try alt+m in following line (extracted from these changes):<br>
<br>
        sel := sel copyReplaceAll: ':(?!=)' with: ': '. "blah"<br>
<br>
=============== Diff against Collections-nice.890 ===============<br>
<br>
Item was changed:<br>
  ----- Method: String>>findSelector (in category 'converting') -----<br>
  findSelector<br>
         "Dan's code for hunting down selectors with keyword parts; while this doesn't give a true parse, in most cases it does what we want, in where it doesn't, we're none the worse for it."<br>
         | sel possibleParens |<br>
         sel := self withBlanksTrimmed.<br>
         (sel includes: $:)<br>
                 ifTrue:<br>
                         [sel := sel copyWithRegex: '''[^'']*''' matchesReplacedWith: '''a string'''.<br>
                         sel := sel copyWithRegex: '#[^\[\(\s\.$]*' matchesReplacedWith: '#aSymbol'.<br>
                         sel := sel copyWithRegex: '\$.' matchesReplacedWith: '$x'. "handle $( $[ and $:"<br>
+                        sel := sel copyReplaceAll: ':(?!!=)' with: ': '.        "for the style (aa max:bb) with no space"<br>
-                        sel := sel copyReplaceAll: ':' with: ': '.      "for the style (aa max:bb) with no space"<br>
                         sel := sel copyReplaceAll: '[:' with: '[ :'.    "for the style ([:a) with no space" 
<br>
                         possibleParens := sel substrings.<br>
                         sel := self class streamContents:<br>
                                 [:s | | level |<br>
                                 level := 0.<br>
                                 possibleParens do:<br>
                                         [:token |<br>
                                         (level = 0 and: [token endsWith: ':'])<br>
                                                 ifTrue: [s nextPutAll: token]<br>
                                                 ifFalse: [level := level<br>
                                                                 + (token occurrencesOf: $() - (token occurrencesOf: $))<br>
                                                                 + (token occurrencesOf: $[) - (token occurrencesOf: $])<br>
                                                                 + (token occurrencesOf: ${) - (token occurrencesOf: $})]]]]<br>
                 ifFalse:<br>
                         [sel := self substrings ifNotEmpty: [:tokens | tokens last]].<br>
         sel ifEmpty: [^ nil].<br>
         sel first = $# ifTrue:<br>
                 [sel := sel allButFirst.<br>
                 sel ifEmpty: [^ nil]].<br>
         sel isOctetString ifTrue: [sel := sel asOctetString].<br>
         ^ Symbol lookup: sel!<br>
<br>
<br>
</div>
</span></font>
</body>
</html>