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

ngf-pattern with multiple file-extensions using spaces, not working #2118

Open
TiagoFuelber opened this issue May 7, 2019 · 1 comment
Open

Comments

@TiagoFuelber
Copy link

Hi Daniel.

I figured out that when using ngf-pattern with spaces, the pattern match doesn't work correctly, because it includes the space in the regex pattern.

Example:

ngf-pattern='.xls, .xlsx, .csv'

Then when I try to upload .xlsx or .csv files it says it's not a valid file extension.

Inside the file validation, when it converts the string to regex, it doesn't remove spaces, so the regex pattern output would be: (^.*\.xls$)|(^ \.xlsx$)|(^ \.csv$). The subgroup 2 and 3 are including spaces.

@TiagoFuelber
Copy link
Author

Hi Daniel, can I make the a PR with the fix?

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

No branches or pull requests

1 participant