New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pascalchevrel opened this Issue Jan 19, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@pascalchevrel
Member

pascalchevrel commented Jan 19, 2016

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);
@pascalchevrel

This comment has been minimized.

Show comment
Hide comment
@pascalchevrel

pascalchevrel Jan 28, 2016

Member

We are having an l10n hackathon mid-February and we will have a table with at least 4 people working on Transvision. I am putting that bug in the backlog of bugs to fix for the event.

Member

pascalchevrel commented Jan 28, 2016

We are having an l10n hackathon mid-February and we will have a table with at least 4 people working on Transvision. I am putting that bug in the backlog of bugs to fix for the event.

MatonAnthony added a commit to MatonAnthony/transvision that referenced this issue Feb 12, 2016

MatonAnthony added a commit to MatonAnthony/transvision that referenced this issue Feb 13, 2016

Fix issue #594 and replace every occurence of `preg_grep($search->get…
…Regex(), ` by `$search->grep(`

This doesn't work yet

MatonAnthony added a commit to MatonAnthony/transvision that referenced this issue Feb 13, 2016

Fix issue #594 and replace every occurence of `preg_grep($search->get…
…Regex(), ` by `$search->grep(`

This doesn't work yet

Test is now fixed

MatonAnthony added a commit to MatonAnthony/transvision that referenced this issue Feb 13, 2016

Fix issue #594 and replace every occurence of `preg_grep($search->get…
…Regex(), ` by `$search->grep(`

This doesn't work yet

Test is now fixed

Typo fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment