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 a bug in contain matcher with regexp. #227

merged 1 commit into from Aug 10, 2013


Copy link

@ryotarai ryotarai commented Aug 9, 2013

Regexp#to_s behaves like the following:

[1] pry(main)> /^hello$/.to_s
=> "(?-mix:^hello$)"

-mix means disabling m, i and x options.
To use these options, we should use grep -P (perl regexp) instead of grep.
But grep -P is highly experimental and grep -P may warn of unimplemented features.

So I use Regexp#source instead of Regexp#to_s.
Regexp#source behaves like the following:

[2] pry(main)> /^hello$/.source
=> "^hello$"
Use Regexp#source instead of Regexp#to_s.
@ryotarai ryotarai closed this Aug 9, 2013
Copy link

@mizzy mizzy commented Aug 9, 2013

Did you close this issue by mistake?

Copy link
Contributor Author

@ryotarai ryotarai commented Aug 10, 2013

I'm sorry that I closed this pull request temporarily because I wondered this is implemented in a correct way.
I reopened now. Please merge this.

@ryotarai ryotarai reopened this Aug 10, 2013
mizzy added a commit that referenced this issue Aug 10, 2013
Fix a bug in contain matcher with regexp.
@mizzy mizzy merged commit ffce49a into mizzy:master Aug 10, 2013
1 check passed
Copy link

@mizzy mizzy commented Aug 10, 2013

Thanks.I've merged and released as v0.7.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
2 participants