mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 07:22:50 +00:00
AK: Make String::matches() capable of reporting match positions too
Also, rewrite StringUtils::match(), because the old implementation was fairly broken, e.g. "acdcxb" would *not* match "a*?b".
This commit is contained in:
parent
2d6d1ca67f
commit
0801b1fada
Notes:
sideshowbarker
2024-07-19 01:39:37 +09:00
Author: https://github.com/alimpfard
Commit: 0801b1fada
Pull-request: https://github.com/SerenityOS/serenity/pull/3858
7 changed files with 86 additions and 33 deletions
|
@ -270,6 +270,11 @@ String String::repeated(char ch, size_t count)
|
|||
return *impl;
|
||||
}
|
||||
|
||||
bool String::matches(const StringView& mask, Vector<MaskSpan>& mask_spans, CaseSensitivity case_sensitivity) const
|
||||
{
|
||||
return StringUtils::matches(*this, mask, case_sensitivity, &mask_spans);
|
||||
}
|
||||
|
||||
bool String::matches(const StringView& mask, CaseSensitivity case_sensitivity) const
|
||||
{
|
||||
return StringUtils::matches(*this, mask, case_sensitivity);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue