Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: more predefined 'pieces' of regexps #7

Open
danielroe opened this issue Jul 17, 2022 · 2 comments
Open

feat: more predefined 'pieces' of regexps #7

danielroe opened this issue Jul 17, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@danielroe
Copy link
Member

danielroe commented Jul 17, 2022

🆒 Your use case

Suggestion

🆕 The solution you'd like

You should add macroability and predefine some macros like http link, xml tag or i don't know maybe uk phone macros etc.

https://twitter.com/senbanabakhele/status/1548715207194824706

More examples:

  • US Phone Numbers
  • Email Validation

#48

🔍 Alternatives you've considered

No response

ℹ️ Additional info

No response

@danielroe danielroe added the enhancement New feature or request label Jul 17, 2022
@danielroe danielroe assigned danielroe and unassigned danielroe Jul 17, 2022
@xRSquared
Copy link
Contributor

@danielroe I have some time this month to contribute, so I plan to work on adding some predefined pieces of regexps.
I'm thinking of the following to start:

  • IPv4
  • IPv6
  • HTTP(S) URLs
  • Phone Numbers
  • Basic email validation
    • As mentioned in #48 , full validation is quite tricky

Usage

I think usage will look something like this:

import { ipv4 } from 'magic-regex/predefined'
  • @danielroe Any other ideas and a better module name would be greatly appreciated.

  • If anyone else has already started working on this, please let me know so we don't duplicate efforts.

P.S. I figured I'd mention this here: I use Python quite a bit, and I like the API of this package. So if time permits, I might make a python package with a similar API to magic-regex - obviously without the compile-time type hinting magic 😆.

@danielroe
Copy link
Member Author

That sounds great to me. And let me know when you've got your Python package up so I can link to it...

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants