quasilyte/phpgrep

Can we support case-insensitive?

sohaha opened this issue · 5 comments

Can we support case-insensitive?

Hello. Could you provide some pattern examples and what they're supposed to match with the case-insensitive mode?

<?php
class a
{
    public static function js()
    {
    }
}

a::js();

a::Js();

a::JS();

// they should be the same
phpgrep test.php 'a::js()'

# test.php:9: a::js()

Interesting! This sounds useful.

You can try building the phpgrep from master branch.

It will do a case insensitive matching by the default as I think it's a more common case when you want f() to match both f() and F(). If case sensitive matching is required, it can be enabled with -case-sensitive flag.

perfect 👍