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

RegEx in allow fields #87

Open
y-marui opened this issue Mar 28, 2022 · 0 comments
Open

RegEx in allow fields #87

y-marui opened this issue Mar 28, 2022 · 0 comments

Comments

@y-marui
Copy link

y-marui commented Mar 28, 2022

I have trouble with ignoring specific cases using RegEx.
I tested the two simple rules below.
Both of them are expected to convert AB to XX except AB is a part of ABCD.
(I actuary want to ignore something like /AB(CD|EF|GH)/ but it is just demo rules to simplify the problem.)

But the first rule below also converts ABCD to XXCD.

id: 01FZ7VNZECWHMNE5S9X8T9QSQN
description: ''
expected: XX
patterns: 
  - /AB/i
allows: 
  - /ABCD/
specs: []
tags: []

While the equivalent rule below works correctly.

id: 01FZ7VNZECWHMNE5S9X8T9QSQN
description: ''
expected: XX
patterns: 
  - /AB/i
allows: 
  - ABCD
specs: []
tags: []

The problem may occur only if one uses the RegEx in the allows field.

My environment is as follows.
macOS 12.2.1
node v17.8.0
npm 8.5.5
@proofdict/textlint-rule-proofdict@3.1.2

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