mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:57:35 +00:00
find: Use PosixExtended
regex syntax instead of PosixBasic
This is the same syntax used by `grep -E`.
This commit is contained in:
parent
0a02c7a926
commit
9808f8164f
1 changed files with 4 additions and 4 deletions
|
@ -270,7 +270,7 @@ private:
|
||||||
|
|
||||||
class RegexCommand : public Command {
|
class RegexCommand : public Command {
|
||||||
public:
|
public:
|
||||||
RegexCommand(Regex<PosixBasic>&& regex)
|
RegexCommand(Regex<PosixExtended>&& regex)
|
||||||
: m_regex(move(regex))
|
: m_regex(move(regex))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -283,7 +283,7 @@ private:
|
||||||
return match_result.success;
|
return match_result.success;
|
||||||
}
|
}
|
||||||
|
|
||||||
Regex<PosixBasic> m_regex;
|
Regex<PosixExtended> m_regex;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AccessCommand final : public Command {
|
class AccessCommand final : public Command {
|
||||||
|
@ -448,14 +448,14 @@ static OwnPtr<Command> parse_simple_command(Vector<char*>& args)
|
||||||
} else if (arg == "-regex") {
|
} else if (arg == "-regex") {
|
||||||
if (args.is_empty())
|
if (args.is_empty())
|
||||||
fatal_error("-regex: requires additional arguments");
|
fatal_error("-regex: requires additional arguments");
|
||||||
Regex<PosixBasic> regex { args.take_first(), PosixFlags::Default };
|
Regex<PosixExtended> regex { args.take_first(), PosixFlags::Default };
|
||||||
if (regex.parser_result.error != regex::Error::NoError)
|
if (regex.parser_result.error != regex::Error::NoError)
|
||||||
fatal_error("{}", regex.error_string());
|
fatal_error("{}", regex.error_string());
|
||||||
return make<RegexCommand>(move(regex));
|
return make<RegexCommand>(move(regex));
|
||||||
} else if (arg == "-iregex") {
|
} else if (arg == "-iregex") {
|
||||||
if (args.is_empty())
|
if (args.is_empty())
|
||||||
fatal_error("-iregex: requires additional arguments");
|
fatal_error("-iregex: requires additional arguments");
|
||||||
Regex<PosixBasic> regex { args.take_first(), PosixFlags::Insensitive };
|
Regex<PosixExtended> regex { args.take_first(), PosixFlags::Insensitive };
|
||||||
if (regex.parser_result.error != regex::Error::NoError)
|
if (regex.parser_result.error != regex::Error::NoError)
|
||||||
fatal_error("{}", regex.error_string());
|
fatal_error("{}", regex.error_string());
|
||||||
return make<RegexCommand>(move(regex));
|
return make<RegexCommand>(move(regex));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue