<div class="gmail_quote">my use case is for substutition, and so need to work with regex-replace, as its third argument, I don't think the grouping operator works in that case... some named sub-expression could do it I believe, I can't find any information about Racket supporting this, am I wrong? <div>
<div></div><div class="h5"><br>
<br><div class="gmail_quote">2011/6/22 Matthew Flatt <span dir="ltr"><<a href="mailto:mflatt@cs.utah.edu" target="_blank">mflatt@cs.utah.edu</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You could wrap the "\1" with the grouping operator "(?:...)":<br>
<br>
> (regexp-match #px"(.*)\\1001" "abcabc001")<br>
bad pregexp string: backreference number is larger than the<br>
highest-numbered cluster<br>
> (regexp-match #px"(.*)(?:\\1)001" "abcabc001")<br>
'("abcabc001" "abc")<br>
<div><div></div><div><br>
At Wed, 22 Jun 2011 09:52:09 -0400, Louis-Philippe wrote:<br>
> Hi all,<br>
><br>
> I have a small question about regexp-match:<br>
><br>
><br>
> when I want to insert a sub-expression followed by a number what should I<br>
> write?<br>
><br>
> like "\1001" to insert sub-expression 1 followed by 001<br>
><br>
> right now tries to insert sub-expression 1001... is there a way to<br>
> escape this?<br>
><br>
><br>
> thanks!<br>
><br>
><br>
> L-P<br>
><br>
><br>
> p.s. I double posted on the IRC... so the first good response I get I will<br>
> re-post, thanks!<br>
</div></div>> _________________________________________________<br>
> For list-related administrative tasks:<br>
> <a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a><br>
</blockquote></div><br>
</div></div></div><br>