Skip to content

Use v regexp flag instead of u #178

Closed

Description

@nicolo-ribaudo

The v flags add more support to regular expression features:

The HTML <input>'s pattern attribute has also been recently updated to use v instead of u (https://html.spec.whatwg.org/#compiled-pattern-regular-expression).

Activity

  1. bathos commented on Jul 13, 2023

    @bathos

    The “set operations” would be useful. I‘m pretty sure the second never will be, though, because ...

     new URLPattern({ pathname: "/🍒" }).test("https://bar.com/🍒"); true new URLPattern({ pathname: "/(\p{Emoji})" }).test("https://bar.com/🍒"); false new URLPattern({ pathname: "/(\p{Ll})" }).test("https://bar.com/a"); true new URLPattern({ pathname: "/(\p{Ll})" }).test("https://bar.com/é"); false new URLPattern({ pathname: "/%F0%9F%8D%92" }).test("https://bar.com/🍒"); true

    — the illusion that non-ASCII is matchable is limited to literal input: it converts non-ASCII input to percent encoded UTF-8, but regexp pattern components aren’t likewise “translated”, so expressing things like \p{RGI_Emoji_Sequence} seems to always require input that’s similar to what transpilers might produce today for engines that don’t support multi- or single- codepoint properties at all.

  2. self-assigned this
    on Sep 13, 2023
  3. added a commit that references this issue on Sep 13, 2023
    9504c41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions