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

make --grep case insensitive? #808

Closed
eldargab opened this issue Apr 13, 2013 · 9 comments
Closed

make --grep case insensitive? #808

eldargab opened this issue Apr 13, 2013 · 9 comments
Labels
type: feature enhancement proposal

Comments

@eldargab
Copy link

No description provided.

@tj
Copy link
Contributor

tj commented Apr 22, 2013

+1 from me

@pawanspace
Copy link

I have this forked branch https://github.com/pawanspace/mocha. grep is case insensitive. Another branch is https://github.com/pawanspace/mocha/tree/mocha-grep-ignorecase-optional it has option --ncgrep for case insensitive grep. I have not done so much of testing but basic functionality seems to be working. Let me know if it's not. thanks

@erezesk
Copy link

erezesk commented Apr 8, 2015

Hey,

Since grep is now regexp based, I tried sending /pattern/i but didn't seem to work
Is there a different way of getting the Grep to be case insensitive?

Thanks :)

@boneskull boneskull added type: feature enhancement proposal status: accepting prs Mocha can use your help with this one! labels Apr 9, 2015
@a8m a8m self-assigned this Apr 9, 2015
a8m added a commit to a8m/mocha that referenced this issue Apr 10, 2015
Add the ability to pass grep as a regexp-like string(query in the
browser, and flag in the console).
This improvement gives you pass a regexp that including a flag.
e.g: '/[^0-9]/g', '/a/i', etc...
a8m added a commit to a8m/mocha that referenced this issue Apr 10, 2015
Add the ability to pass grep as a regexp-like string. (query in the
browser or flag in the cli).
This improvement gives you pass a regexp that including a flag, and
solved mochajs#808 as well.
a8m added a commit to a8m/mocha that referenced this issue Apr 10, 2015
Add the ability to pass grep as a regexp-like string. (query in the
browser or flag in the cli).
This improvement gives you pass a regexp that including a flag, and
solved mochajs#808 as well.
a8m added a commit to a8m/mocha that referenced this issue Apr 18, 2015
Add the ability to pass grep as a regexp-like string. (query in the
browser or flag in the cli).
This improvement gives you pass a regexp that including a flag, and
solved mochajs#808 as well.
a8m added a commit to a8m/mocha that referenced this issue Jul 18, 2015
Add the ability to pass grep as a regexp-like string. (query in the
browser or flag in the cli).
This improvement gives you pass a regexp that including a flag, and
solved mochajs#808 as well.
boneskull added a commit that referenced this issue Aug 16, 2015
feature(mocha/grep): improve grep - issue #808
boneskull pushed a commit that referenced this issue Jul 1, 2016
Add the ability to pass grep as a regexp-like string. (query in the
browser or flag in the cli).
This improvement gives you pass a regexp that including a flag, and
solved #808 as well.
boneskull pushed a commit that referenced this issue Jul 2, 2016
Add the ability to pass grep as a regexp-like string. (query in the
browser or flag in the cli).
This improvement gives you pass a regexp that including a flag, and
solved #808 as well.
boneskull pushed a commit that referenced this issue Jul 2, 2016
Add the ability to pass grep as a regexp-like string. (query in the
browser or flag in the cli).
This improvement gives you pass a regexp that including a flag, and
solved #808 as well.
@boneskull
Copy link
Member

Closed via 6126e38

@shanebdavis
Copy link

What was the conclusion on this issue? Case sensitivity plagues me daily - I miss tests when I'm greping because of case miss-match. Would a patch be accepted that adds a case-insensitive option for web-mocha and command-line mocha? --grep-ignore-case perhaps?

@boneskull
Copy link
Member

@shanebdavis --grep accepts a regular expression, including a flag. --grep '/foo/i' would find Foo and Foo and FOO etc.

@holm
Copy link

holm commented Aug 15, 2019

I would vote to change the default grep to be case-insensitive, when the grepped string is not "regex-like". This could be done in the next major version.

I think the vast majority would find case-insensitive more valuable, and for the edge-cases where that is not desired, they can specify a regex to get exactly what they want.

@boneskull
Copy link
Member

Is --fgrep case-insensitive? If not, that may be a better candidate.

@boneskull
Copy link
Member

(--fgrep is a string-only search; if you want case-sensitive string searches, use --grep <not-a-regex-string>)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature enhancement proposal
Projects
None yet
Development

No branches or pull requests

8 participants