<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div style=" font-size: 12pt">I think that the second option of outputting multiple matches together would be the simplest and most useful. It should definitely be an optional feature though, otherwise it would again damage old patches which use [text search]
 and are expecting only one match. A simple -r flag would seem sufficient for this.</div>
<div style=" font-size: 12pt"><br>
</div>
<div style=" font-size: 12pt">I would also suggest that the output should be a sequence of floats, rather than a list. This seems more consistent with other PD objects, and more useful, since you probably want to [get] the matches immediately anyway. But this
 is a minor detail.<br>
</div>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I can see that the first option of introducing ranges is more powerful and opens up more possibilities. However, I'm guessing it would require a new inlet on the object, and the second inlet on [text search] is already taken for setting the pointer. So you'd
 either need to break backwards compatibility for [text search], or break the convention of the pointer being the farthest right inlet.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
However, I have another idea for fixing ranges in [text search]. You can currently search in specific fields using arguments (so [text search mytext 0 1] allows you to search in the 1st and 2nd fields of the text only). I suggest a special field--say "-1" or
 "range"--that allows you to search against the line number. So for instance, searching "cat 5 10" into [text search mytext 0 < field > field] would search for a text entry after line number 5 but before 10 with "cat" as its 1st term. This would allow you to
 access ranges without having to worry about new inlets.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I've suggested this before and I still think that it would be a great feature. However, I don't think that it would be the best solution for recursive searching, and I would love to see a new "-r" feature and a "range" feature implemented together. I say this
 because 1: using ranges to achieve multiple results is not trivial--not for new users anyway, and especially not compared to a simple "-r" flag. And 2: I'm guessing that it would be less efficient.<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Miller Puckette <msp@ucsd.edu><br>
<b>Sent:</b> 21 July 2018 13:28<br>
<b>To:</b> Liam Goodacre<br>
<b>Cc:</b> PD list<br>
<b>Subject:</b> Re: [PD] recursive searching with [text search]</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">I keep thinking about that too.  One idea would be to specify a range of<br>
lines to search in, so that one could use the results of the previous search<br>
to start teh next one.<br>
<br>
Another would be to output a list of ALL search-matches.<br>
<br>
cheers<br>
Miller<br>
<br>
On Sat, Jul 21, 2018 at 09:10:57AM +0000, Liam Goodacre wrote:<br>
> People often ask about how to get multiple matches with [text search] (see here<<a href="https://forum.pdpatchrepo.info/topic/11504/multiple-search-results-in-text">https://forum.pdpatchrepo.info/topic/11504/multiple-search-results-in-text</a>>). There are
 a few ways of doing it but none of them are very optimal, and it seems like something that would be much easier and more efficient if it were implemented with code.<br>
> <br>
> Would there be any traction for a new feature, say [text search -r], to allow for recursive searching?<br>
<br>
> _______________________________________________<br>
> Pd-list@lists.iem.at mailing list<br>
> UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list">
https://lists.puredata.info/listinfo/pd-list</a><br>
<br>
</div>
</span></font></div>
</body>
</html>