You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to test the Regex function, and I have the following regular expression: (\d+)(?!.*\d)") which matches the last number of the input. I see Expressive is correctly accepting my regex by doing the following:
Regex("Test", "(\d+)(?!.*\d)")
Which returns False (there are no numbers in "Test")
and
Regex("Test123", "(\d+)(?!.*\d)")
Which returns True
What I really need, however, is to get the first match returned back.
So, in the first example above, I'd have an empty string returned instead of False, and in the second example above, I'd have "123" returned instead of True. Is this possible?
The text was updated successfully, but these errors were encountered:
NOTE this will replace the existing Regex function. If you wanted to use both then you would need to register with a different name or make your overriding function more complex so it could handle both scenarios.
Hello -
First off, thanks so much for the great library!
I'm trying to test the Regex function, and I have the following regular expression: (\d+)(?!.*\d)") which matches the last number of the input. I see Expressive is correctly accepting my regex by doing the following:
Regex("Test", "(\d+)(?!.*\d)")
Which returns False (there are no numbers in "Test")
and
Regex("Test123", "(\d+)(?!.*\d)")
Which returns True
What I really need, however, is to get the first match returned back.
So, in the first example above, I'd have an empty string returned instead of False, and in the second example above, I'd have "123" returned instead of True. Is this possible?
The text was updated successfully, but these errors were encountered: