[racket] Is there a symbol in regexp-match syntax, similar to the period but...

From: Norman Gray (norman at astro.gla.ac.uk)
Date: Wed May 8 12:18:24 EDT 2013

Don, hello.

On 2013 May 8, at 17:06, Don Green wrote:

> The ___ below represents the pattern and all the remaining characters in
> the string to the right of the pattern 'x':
> (regexp-match #rx"x___" "12x4x6") ; => '("x4x6")
> I realize I could place a period for each character I want matched but the
> number of characters will vary.  I imagine there might be a better way than
> creating a function that counts the number of characters and then another
> function that creates a regexp-match expression and another function that
> runs that function.

Does the '*' pattern help?

Welcome to Racket v5.3.2.
> (regexp-match #rx"x.*" "12x4x6")

All the best,


Norman Gray  :  http://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK

Posted on the users mailing list.