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

Support case-insensitive match #40

Open
th0ger opened this issue Apr 2, 2020 · 3 comments
Open

Support case-insensitive match #40

th0ger opened this issue Apr 2, 2020 · 3 comments

Comments

@th0ger
Copy link

th0ger commented Apr 2, 2020

I would be great if you could support case-insensitive matching.

Or elaborate the docs, if this is already possible?

@th0ger
Copy link
Author

th0ger commented Apr 2, 2020

Both regex and re support IGNORECASE arguments.

Maybe it would be possible to just pass *args and **kwargs onto regex/re?

@goldstar611
Copy link

I think winpat's PR, #39 would give you what you need, right?

@th0ger
Copy link
Author

th0ger commented Aug 19, 2020

Yes, I believe it would... whenever #39 build succeeds and a new pygrok version is released.

# python=3.8.5, pygrok=1.0.0

from pygrok import Grok
import re
text = 'gary IS male'
pattern = '%{WORD:name} is %{WORD:gender}'
grok = Grok(pattern, flags=re.IGNORECASE)
print (grok.match(text))

# -> unexpected keyword argument 'flags'

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