Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.
This repository was archived by the owner on May 30, 2024. It is now read-only.

Wildcard dot where literal dot expected? #7

Open

Description

In cv.js both validationPattern have "(.[0-9]+)+" which afaik is intended to match dot separated numbers.

Unless JS regex is wildly different, this would normally be written "(.[0-9]+)+"

Activity

  1. jehumb-havok commented on May 30, 2023

    @jehumb-havok

    Just to confirm it's broken, see https://regex101.com/r/tbYsWN/1 where I can match a % instead of the . in one of the official spec examples:

    image
  2. stkenned-havok commented on May 30, 2023

    @stkenned-havok
    MemberAuthor

    Reading the spec, https://github.com/microsoft/CorrelationVector/blob/master/cV%20-%202.1.md there are more things wrong with the regex.

    1. There are 21 'full' base64 digits and the last one has at most 2 low bits set "[AQgw]". This is so that the base64 part fits in 128 bit value (216 + 12) = 128
    2. The dot should be escaped (as mentioned above)
    3. There is an optional '!' terminator

    I believe the cV2 regex should be

    new RegExp("^[" + base64CharSet + "]{21}[AQgw](\.[0-9]+)+!?$")

  3. jehumb-havok commented on May 30, 2023

    @jehumb-havok

    Validated this seems to work indeed:

    https://regex101.com/r/22xreE/1

    First and last don't match, middle ones do:

    image
  4. jehumb-havok commented on Jul 5, 2023

    @jehumb-havok

    Ping mmckenz / sathishcg / Jerry Blake (@JerryBlake), anybody looking at issues in this repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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