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

check.Matches doesn't work with multi-line strings #94

Open
ashb opened this issue Jan 27, 2017 · 1 comment
Open

check.Matches doesn't work with multi-line strings #94

ashb opened this issue Jan 27, 2017 · 1 comment

Comments

@ashb
Copy link

ashb commented Jan 27, 2017

For example I haven't found a way to make this work.

c.Check("one\ntwo", Matches, ".*two.*")

Because the matches must be a string, and that string is wrapped with ^ and $ we can't add our own flags either.

A possible quick fix is to check if the pattern is a regexp.Regexp, in which case don't compile the pattern ourselves.

@barrettj12
Copy link

If you prefix your string with (?m), it should work.

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

2 participants