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

feature request: provide op.test() #201

Open
dan-reznik opened this issue Jun 4, 2021 · 3 comments
Open

feature request: provide op.test() #201

dan-reznik opened this issue Jun 4, 2021 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@dan-reznik
Copy link

Dear Jeff can you also make available op.test(str, regexp) to test if a particular string contains a particular regexp? (similar to the string method in js) thanks

@jheer jheer added enhancement New feature or request question Further information is requested labels Jun 7, 2021
@jheer
Copy link
Member

jheer commented Jun 7, 2021

You can use op.match(value, regexp) for this purpose. If needed, you can coerce the result to a boolean (match or no match) using !!op.match(value, regexp). Or is there a reason that match doesn't work for you?

@dan-reznik
Copy link
Author

dan-reznik commented Jun 7, 2021 via email

@jheer
Copy link
Member

jheer commented Jun 7, 2021

OK, thanks. I'm curious: what level of performance difference do you see in that case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants