Skip to content

Conversation

hiteshbedre
Copy link

When we define ^ in a square bracket it negate the matches.
Example:
[^abc] : matches any char except a, b or c.
[^a-z] : matches any character except lower alphabets
[^a-z0-9] : matches any character except lower alphabets and numbers

So changed name of variable to non_alphanumeric.
Here I have created playground for same scenario: https://regex101.com/r/zmEBu2/1

@hiteshbedre
Copy link
Author

If I assume you wanted to match only alphanumeric string only then we just need alter the pattern to [a-z0-9] keeping variable name same.

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.

1 participant