<div class="gmail_quote">On Sat, Jun 4, 2011 at 01:02, Rodolfo Carvalho <span dir="ltr"><<a href="mailto:rhcarvalho@gmail.com">rhcarvalho@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>[...]<br>
> I couldn't find a way to match groups.<br>
> I'd like to have something like this:<br>
><br>
> (define t "<br>
> 23 12<br>
> 15 45<br>
> 32 27")<br>
> (regexp-match-groups* #px"(\\d+)\\s+(\\d+)" t)<br>
><br>
> => '(("23" "12") ("15" "45") ("32" "27"))<br>
><br>
> Does such a thing exist?<br>
<br>
</div>No. You can do this:<br>
<br>
(regexp-match* #px"(\\d+)\\s+(\\d+)" t)<br>
<br>
where regexp-match gives you all of the complete matches, but not the<br>
matched groups. It could be added, but it seems like a questionable<br>
extension.<br>
<div><br></div></blockquote><div></div></div></div></blockquote></div><br><div><br></div><div><br></div><div>If there would be groups, we could deliberately "ignore" parts of our input -- parts that are important to match a valid sentence but not important for output.</div>
<div><br></div><div>Imagine an scenario that instead of 2 (as above) we had 20 columns of a table, and we wanted to return a table of the squares of the values for all columns, except for columns 12 and 15 (of course we could parse them out and ignore then when processing/returning, but you get the idea...)</div>
<div><br></div><div>[]'s</div><div><br></div><div>Rodolfo Carvalho</div><div><br></div>