Repository navigation
feat: add RegExp converter - #368
Merged
Merged
Conversation
Member
|
Goodness, I can't believe I didn't see this previously! Thank you. I'll review more fully later. |
|
|
||
| it('char', () => { | ||
| expect(convert(/\x3B/)).toMatchInlineSnapshot(`"';'"`) | ||
| expect(convert(/\42/)).toMatchInlineSnapshot(`"'*'"`) |
Check warning
Code scanning / CodeQL
Unbound back reference
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #368 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 629 629
Branches 65 65
=========================================
Hits 629 629 ☔ View full report in Codecov by Sentry. |
danielroe
approved these changes
Mar 6, 2024
danielroe
left a comment
Member
There was a problem hiding this comment.
I love this! ❤️
I'd also like to get a playground up so people can play with converting regular expressions back and forth - so it couldn't have come at a better time.
Let's merge as a subpath export, and then iterate. 🙏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
Apologies, there's no linked issue, as this was originally a feature for my personal use.
❓ Type of change
📚 Description
The purpose of creating this converter is due to some of my projects having a large amount of Regex that are difficult to maintain and read. I hope to revamp them using magic-regexp. However, given the vast and complex quantity of Regex, I aim to facilitate their transformation with this converter.
While developing the converter, I discovered some regex syntaxes not yet supported by magic-regexp. Therefore, I've specifically marked these instances in the code with comments or throw error messages. This is to facilitate future modifications when these features are supported. Hence, this converter might also serve as a tracking tool for a functionality todo list, identifying missing regex features.
If this converter could be developed into a UI and integrated into the documentation page in the future, it might enable developers who are new to magic-regexp to get up to speed more quickly. Additionally, it could also encourage more developers to contribute test cases to the converter.
I believe there are many areas where the current converter can be improved, such as accommodating some unforeseen test cases. I'm uncertain whether I should create a PR for the current progress of the converter into this repository, or if it should be split into a separate project. I would appreciate any advice on this matter.
For details usage description and demo, please refer to
./converter/README.md.📝 Checklist