Skip to content

add a grep() method to the search class #594

@pascalchevrel

Description

@pascalchevrel

Small note to add a utility grep() function to our search class. Because almost every time we prepare a regex it is to grep data into it so we end up with code such as:

$filtered_strings = preg_grep($search->getRegex(), $source_strings);

And this would be shorter and more readable IMO:

$filtered_strings = $search->grep($source_strings);

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions