-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Bug] Can't escaped a period ('.') in an anyOf call #75
Comments
Good catch, TS regex optimizes single characters classes, which causes Either way, I will issue a bug fix for that. |
Agreed, I'll use "." from now on.
This was a nightmare bug to track down. A fix is needed.
…On Tue, Mar 26, 2024 at 6:28 PM Maciej Jastrzebski ***@***.***> wrote:
Good catch, TS regex optimizes single characters classes, which causes .
to be come any. Simple mitigation would be to avoid using anyOf("."), and
just use ., there is no need to add anyOf for single character.
Either way, I will issue a bug fix for that.
—
Reply to this email directly, view it on GitHub
<#75 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BA6V6ZTWWOCIMLYCKPFXE6DY2HSAXAVCNFSM6AAAAABFH26DY6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRRGU3TOOBWG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Fixed by #76 |
Resolved in v1.4.0 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Due to the missing constructor (issue #74) I tried to use anyOf('.') in the following:
The result was an unescaped period ('.') (match any character) in the regex. This caused a number of weird issues
which kept me company all weekend.
I then tried an escaped period in the anyOf:
There was no change, the result was an unescaped period.
To Reproduce
Expected behavior
I expected to match the period in hostnames (i.e. www.google.com).
Screenshots
If applicable, add screenshots to help explain your problem.
Package version
ts-regex-builder: ???
The text was updated successfully, but these errors were encountered: