Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 9, 2025. It is now read-only.
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Numerical quantifies don't work when SRL contains a non-capturing group #11

Closed
@AdamJacobson

Description

@AdamJacobson

I was trying to translate this regex for US zipcodes to SRL:^[0-9]{5}(?:-[0-9]{4})?$

The SRL I came up with was this:
begin with, digit, exactly 5 times, ( literally '-', digit, exactly 4 times ), optional, must end
and I tested it on thesimple regex site:

however, creating a new SRL object with this as input results in the following error:

Invalid parameter given for exactly at SyntaxException (<local_path>/node_modules/SRL/lib/Exceptions/Syntax.js:3:1) at buildQuery (<local_path>/node_modules/SRL/lib/Language/Helpers/buildQuery.js:49:23) at Interpreter.build (<local_path>/node_modules/SRL/lib/Language/Interpreter.js:32:24) at new Interpreter (<local_path>/node_modules/SRL/lib/Language/Interpreter.js:22:18) at new SRL (<local_path>/node_modules/SRL/lib/SRL.js:14:9)

But if I change the input fromexactly 5 times totwice, everything works as expected:
begin with, digit, twice, ( literally '-', digit, exactly 4 times ), optional, must end

This issue does not occur if the SRL does not contain a non-capturing group.

Here's a shorter SRL text which causes the issue:
digit, exactly 5 times, (letter, twice) optional

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp