> On Jan 9, 2016, at 1:38 AM, David Storrs wrote:
>
> Related question: Perl has a capacity to change your delimiters on regexen
> in order to avoid having to backwhack everything.
The raw-string package allows this for strings:
#lang raw-string/raw-string racket
> ...and extract the following strings:
> "[X] Escape with Inoue-sensei"
> "[X] Forget all these disloyal options and stick with Shikigami-sensei's
> plan"
> What method would you suggest for that?
There's nothing wrong with `regexp-whatever`. But because Racket has so
many good tools for list
On Sat, Jan 9, 2016 at 9:44 AM, Alex Knauth wrote:
>
>> On Jan 9, 2016, at 1:38 AM, David Storrs wrote:
>>
>> Related question: Perl has a capacity to change your delimiters on
>> regexen in order to avoid having to backwhack everything.
>
> [...]
>
Matthew writes:
> Repeated application of `string-split` is my secret weapon.
(filter (curryr string-prefix? "[X]") (string-split str "\n"))
To say nothing of string-prefix? (new in 6.3) and curryr - nice!
Somewhat more explicit (and verbose) variations:
(filter (λ (line) (string-prefix?
I'm having some trouble with the syntax for regexen, and the docs are a bit
opaque on this point.
Given this:
(regex-match*
#px"\[[xX\d]\]"
"[1] foo \n [2] bar \n [x] baz \n [X] baz \n"")
I'm expecting it to return:
( "[1]" "[2]" "[x]" "[X]")
Instead it complains about undefined
On Fri, Jan 8, 2016 at 10:56 PM, Neil Van Dyke wrote:
> David Storrs wrote on 01/09/2016 01:38 AM:
>
>>
>> (regex-match*
>> #px"\[[xX\d]\]"
>> "[1] foo \n [2] bar \n [x] baz \n [X] baz \n"")
>>
>
> (regexp-match*
> #px"\\[[xX\\d]\\]"
> "[1] foo \n [2] bar \n [x]
> You could make a Racket reader that did this. Or you can find some of the
> interesting s-expression regular expression languages (I think Olin Shivers
> did one). Or just not use regexps so much
> ("http://regex.info/blog/2006-09-15/247”).
When telling someone to avoid something useful,
David Storrs wrote on 01/09/2016 02:34 AM:
What method would you suggest for that?
Probably regular expression. :)
Neil V.
--
You received this message because you are subscribed to the Google Groups "Racket
Users" group.
To unsubscribe from this group and stop receiving emails from it,
8 matches
Mail list logo