quasilyte / phpgrep

Syntax-aware grep for PHP code.
MIT License
236 stars 10 forks source link

Can we support case-insensitive? #57

Closed sohaha closed 3 years ago

quasilyte commented 3 years ago

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

sohaha commented 3 years ago
<?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()
quasilyte commented 3 years ago

Interesting! This sounds useful.

quasilyte commented 3 years ago

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.

sohaha commented 3 years ago

perfect 👍