Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user to use real Regex #43

Open
hieudmg opened this issue Oct 14, 2023 · 0 comments
Open

Allow user to use real Regex #43

hieudmg opened this issue Oct 14, 2023 · 0 comments

Comments

@hieudmg
Copy link

hieudmg commented Oct 14, 2023

It would be nice if users can specify a whole Regex for the match pattern.

I'm a web developer and I my local version of live sites url looks like this: http://local.<live-host>, and the pattern local.* does not work.

I tried editing the extension code:

File: /src/util/matcher-regex.ts, add these lines from line 13:

  try {
    const m = matcher.match(/^([/~@;%#'])(.*?)\1([gimsuy]*)$/);
    if (m) {
      return new RegExp(m[2], m[3]);
    }
  } catch (e) {
  }

Then I can put this in the input field: /^.*://local\..*$/ and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant