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

Fix: isCurrency symbol validator regex #1306

Conversation

islasjuanp
Copy link
Contributor

Some of the currency symbols starts with letters. For example:

  • Brazil Real R$
  • Dominican Republic Peso RD$

For those cases, the RegExp pattern created to validate the currency simbol is not valid:

Generated regex:

 -?(\R$) ?(0|[1-9]\d*|[1-9]\d{0,2}(\,\d{3})*)?(\.(\d{2}))?

Expected regex:

-?(R\$) ?(0|[1-9]\d*|[1-9]\d{0,2}(\.\d{3})*)?(\,(\d{2}))?

Resolves #1292

Copy link
Member

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@profnandaa
Copy link
Member

Thanks for your contribution! 🎉

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

Successfully merging this pull request may close these issues.

IsCurrency symbol validation error
2 participants