magic-regexp icon indicating copy to clipboard operation
magic-regexp copied to clipboard

feat: add RegExp converter

Open serkodev opened this issue 1 year ago โ€ข 1 comments

๐Ÿ”— Linked issue

Apologies, there's no linked issue, as this was originally a feature for my personal use.

โ“ Type of change

  • [ ] ๐Ÿ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • [ ] ๐Ÿž Bug fix (a non-breaking change that fixes an issue)
  • [ ] ๐Ÿ‘Œ Enhancement (improving an existing functionality like performance)
  • [x] โœจ New feature (a non-breaking change that adds functionality)
  • [ ] ๐Ÿงน Chore (updates to the build process or auxiliary tools and libraries)
  • [ ] โš ๏ธ Breaking change (fix or feature that would cause existing functionality to 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

  • [ ] I have linked an issue or discussion.
  • [ ] I have updated the documentation accordingly.

serkodev avatar Jan 06 '24 19:01 serkodev

Goodness, I can't believe I didn't see this previously! Thank you. I'll review more fully later.

danielroe avatar Feb 23 '24 22:02 danielroe

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (892a9e9) to head (ed9d2b3). Report is 2 commits behind head on main.

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           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 06 '24 23:03 codecov[bot]