:std/pregexp: produces invalid matches #599

Open
opened 2021-03-06 19:49:14 +00:00 by yanndegat · 3 comments
yanndegat commented 2021-03-06 19:49:14 +00:00 (Migrated from github.com)

:std/pregexp seems to produce wrong matches

compared to racket regexp and pregexp, the same regular expresssion
produces a wrong matches.

example here: the regexp is supposed to match urls and extract submatches.

the "user" match is wrong on gerbil for the first 2 urls

https://gist.github.com/yanndegat/3790c3ac97823fad7242ba589e3e8a17

the regexp definition is a copy/paste from github.com/racket/racket@46a191df03/racket/collects/net/url-string.rkt (L185)

:std/pregexp seems to produce wrong matches compared to racket regexp and pregexp, the same regular expresssion produces a wrong matches. example here: the regexp is supposed to match urls and extract submatches. the "user" match is wrong on gerbil for the first 2 urls https://gist.github.com/yanndegat/3790c3ac97823fad7242ba589e3e8a17 the regexp definition is a copy/paste from https://github.com/racket/racket/blob/46a191df038244199f83f2bb1235beb8ca137f9a/racket/collects/net/url-string.rkt#L185
vyzo commented 2021-03-08 08:54:19 +00:00 (Migrated from github.com)

The pregexp syntax is slightly different than racket's regexp syntax.
Can you reduce it to a simple regexp that demonstrates the problem?

The pregexp syntax is slightly different than racket's regexp syntax. Can you reduce it to a simple regexp that demonstrates the problem?
yanndegat commented 2021-03-08 13:20:50 +00:00 (Migrated from github.com)

hi @vyzo

The pregexp syntax is slightly different than racket's regexp syntax.

ok. but is :std/pregexp different from racket's "pregexp" ?

racket's pregexp seems to be the "perl" version of regexps.
when i test this regexp with racket/regexp, racket/pregexp or a port to srfi-115, it seems to work properly

not with :std/pregexp

i'll try to see how i could simplify it by removing at least the last parts of the regexp

hi @vyzo > The pregexp syntax is slightly different than racket's regexp syntax. ok. but is :std/pregexp different from racket's "pregexp" ? racket's pregexp seems to be the "perl" version of regexps. when i test this regexp with racket/regexp, racket/pregexp or a port to srfi-115, it seems to work properly not with :std/pregexp i'll try to see how i could simplify it by removing at least the last parts of the regexp
vyzo commented 2023-09-22 11:58:47 +00:00 (Migrated from github.com)

It is Dorai Sitaram's pregexp package; see https://ds26gte.github.io/pregexp/index.html

It is Dorai Sitaram's pregexp package; see https://ds26gte.github.io/pregexp/index.html
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mighty-gerbils/gerbil#599
No description provided.