{"action":"created","comment":{"url":"https://api.github.com/repos/yajra/laravel-datatables/pulls/comments/80349057","id":80349057,"diff_hunk":"@@ -177,20 +177,29 @@ public function columnSearch()\n         for ($i = 0, $c = count($columns); $i < $c; $i++) {\n             if ($this->request->isColumnSearchable($i)) {\n                 $this->isFilterApplied = true;\n+                $regex = $this->request->isRegex($i);\n \n                 $column  = $this->getColumnName($i);\n                 $keyword = $this->request->columnKeyword($i);\n \n                 $this->collection = $this->collection->filter(\n-                    function ($row) use ($column, $keyword) {\n+                    function ($row) use ($column, $keyword, $regex) {\n                         $data = $this->serialize($row);\n \n                         $value = Arr::get($data, $column);\n \n                         if ($this->isCaseInsensitive()) {\n-                            return strpos(Str::lower($value), Str::lower($keyword)) !== false;\n+                            if($regex) {\n+                                return preg_match('/' . Str::lower($keyword) . '/', Str::lower($value)) == 1;","path":"src/Engines/CollectionEngine.php","position":19,"original_position":19,"commit_id":"2eb45ce9114f047b5fff27891248fd8ded22647c","original_commit_id":"2eb45ce9114f047b5fff27891248fd8ded22647c","user":{"login":"yajra","id":2687997,"avatar_url":"https://avatars.githubusercontent.com/u/2687997?v=3","gravatar_id":"","url":"https://api.github.com/users/yajra","html_url":"https://github.com/yajra","followers_url":"https://api.github.com/users/yajra/followers","following_url":"https://api.github.com/users/yajra/following{/other_user}","gists_url":"https://api.github.com/users/yajra/gists{/gist_id}","starred_url":"https://api.github.com/users/yajra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yajra/subscriptions","organizations_url":"https://api.github.com/users/yajra/orgs","repos_url":"https://api.github.com/users/yajra/repos","events_url":"https://api.github.com/users/yajra/events{/privacy}","received_events_url":"https://api.github.com/users/yajra/received_events","type":"User","site_admin":false},"body":"I think we can use preg_match with `i` flag as per this [SO post](http://stackoverflow.com/questions/12411037/how-do-i-make-this-preg-match-case-insensitive)?","created_at":"2016-09-24T01:00:46Z","updated_at":"2016-09-24T01:02:21Z","html_url":"https://github.com/yajra/laravel-datatables/pull/765#discussion_r80349057","pull_request_url":"https://api.github.com/repos/yajra/laravel-datatables/pulls/765","_links":{"self":{"href":"https://api.github.com/repos/yajra/laravel-datatables/pulls/comments/80349057"},"html":{"href":"https://github.com/yajra/laravel-datatables/pull/765#discussion_r80349057"},"pull_request":{"href":"https://api.github.com/repos/yajra/laravel-datatables/pulls/765"}}},"pull_request":{"url":"https://api.github.com/repos/yajra/laravel-datatables/pulls/765","id":86452427,"html_url":"https://github.com/yajra/laravel-datatables/pull/765","diff_url":"https://github.com/yajra/laravel-datatables/pull/765.diff","patch_url":"https://github.com/yajra/laravel-datatables/pull/765.patch","issue_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/765","number":765,"state":"open","locked":false,"title":"Support regex column searches when using CollectionEngine","user":{"login":"cadenzajon","id":4250101,"avatar_url":"https://avatars.githubusercontent.com/u/4250101?v=3","gravatar_id":"","url":"https://api.github.com/users/cadenzajon","html_url":"https://github.com/cadenzajon","followers_url":"https://api.github.com/users/cadenzajon/followers","following_url":"https://api.github.com/users/cadenzajon/following{/other_user}","gists_url":"https://api.github.com/users/cadenzajon/gists{/gist_id}","starred_url":"https://api.github.com/users/cadenzajon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cadenzajon/subscriptions","organizations_url":"https://api.github.com/users/cadenzajon/orgs","repos_url":"https://api.github.com/users/cadenzajon/repos","events_url":"https://api.github.com/users/cadenzajon/events{/privacy}","received_events_url":"https://api.github.com/users/cadenzajon/received_events","type":"User","site_admin":false},"body":"The QueryBuilderEngine has support for using Oracle queries to search for regular expressions when a columns 'regex' flag is enabled. This update adds similar functionality to the CollectionEngine using PHP's built-in preg functions.","created_at":"2016-09-23T04:26:04Z","updated_at":"2016-09-24T01:02:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ca62b79e76a397d756477015b0d87129ba09542","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/yajra/laravel-datatables/pulls/765/commits","review_comments_url":"https://api.github.com/repos/yajra/laravel-datatables/pulls/765/comments","review_comment_url":"https://api.github.com/repos/yajra/laravel-datatables/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/765/comments","statuses_url":"https://api.github.com/repos/yajra/laravel-datatables/statuses/2eb45ce9114f047b5fff27891248fd8ded22647c","head":{"label":"cadenzajon:6.0","ref":"6.0","sha":"2eb45ce9114f047b5fff27891248fd8ded22647c","user":{"login":"cadenzajon","id":4250101,"avatar_url":"https://avatars.githubusercontent.com/u/4250101?v=3","gravatar_id":"","url":"https://api.github.com/users/cadenzajon","html_url":"https://github.com/cadenzajon","followers_url":"https://api.github.com/users/cadenzajon/followers","following_url":"https://api.github.com/users/cadenzajon/following{/other_user}","gists_url":"https://api.github.com/users/cadenzajon/gists{/gist_id}","starred_url":"https://api.github.com/users/cadenzajon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cadenzajon/subscriptions","organizations_url":"https://api.github.com/users/cadenzajon/orgs","repos_url":"https://api.github.com/users/cadenzajon/repos","events_url":"https://api.github.com/users/cadenzajon/events{/privacy}","received_events_url":"https://api.github.com/users/cadenzajon/received_events","type":"User","site_admin":false},"repo":{"id":68988291,"name":"laravel-datatables","full_name":"cadenzajon/laravel-datatables","owner":{"login":"cadenzajon","id":4250101,"avatar_url":"https://avatars.githubusercontent.com/u/4250101?v=3","gravatar_id":"","url":"https://api.github.com/users/cadenzajon","html_url":"https://github.com/cadenzajon","followers_url":"https://api.github.com/users/cadenzajon/followers","following_url":"https://api.github.com/users/cadenzajon/following{/other_user}","gists_url":"https://api.github.com/users/cadenzajon/gists{/gist_id}","starred_url":"https://api.github.com/users/cadenzajon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cadenzajon/subscriptions","organizations_url":"https://api.github.com/users/cadenzajon/orgs","repos_url":"https://api.github.com/users/cadenzajon/repos","events_url":"https://api.github.com/users/cadenzajon/events{/privacy}","received_events_url":"https://api.github.com/users/cadenzajon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cadenzajon/laravel-datatables","description":"jQuery DataTables API for Laravel 4|5","fork":true,"url":"https://api.github.com/repos/cadenzajon/laravel-datatables","forks_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/forks","keys_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/teams","hooks_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/hooks","issue_events_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/issues/events{/number}","events_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/events","assignees_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/assignees{/user}","branches_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/branches{/branch}","tags_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/tags","blobs_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/git/refs{/sha}","trees_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/statuses/{sha}","languages_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/languages","stargazers_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/stargazers","contributors_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/contributors","subscribers_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/subscribers","subscription_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/subscription","commits_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/commits{/sha}","git_commits_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/git/commits{/sha}","comments_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/comments{/number}","issue_comment_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/issues/comments{/number}","contents_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/contents/{+path}","compare_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/merges","archive_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/downloads","issues_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/issues{/number}","pulls_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/pulls{/number}","milestones_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/milestones{/number}","notifications_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/labels{/name}","releases_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/releases{/id}","deployments_url":"https://api.github.com/repos/cadenzajon/laravel-datatables/deployments","created_at":"2016-09-23T04:17:52Z","updated_at":"2016-09-23T04:17:54Z","pushed_at":"2016-09-23T21:35:24Z","git_url":"git://github.com/cadenzajon/laravel-datatables.git","ssh_url":"git@github.com:cadenzajon/laravel-datatables.git","clone_url":"https://github.com/cadenzajon/laravel-datatables.git","svn_url":"https://github.com/cadenzajon/laravel-datatables","homepage":"http://datatables.yajrabox.com/","size":2086,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"6.0"}},"base":{"label":"yajra:6.0","ref":"6.0","sha":"1b8c50b9e33a738ecc630e2cbf65138a32932ba7","user":{"login":"yajra","id":2687997,"avatar_url":"https://avatars.githubusercontent.com/u/2687997?v=3","gravatar_id":"","url":"https://api.github.com/users/yajra","html_url":"https://github.com/yajra","followers_url":"https://api.github.com/users/yajra/followers","following_url":"https://api.github.com/users/yajra/following{/other_user}","gists_url":"https://api.github.com/users/yajra/gists{/gist_id}","starred_url":"https://api.github.com/users/yajra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yajra/subscriptions","organizations_url":"https://api.github.com/users/yajra/orgs","repos_url":"https://api.github.com/users/yajra/repos","events_url":"https://api.github.com/users/yajra/events{/privacy}","received_events_url":"https://api.github.com/users/yajra/received_events","type":"User","site_admin":false},"repo":{"id":14735403,"name":"laravel-datatables","full_name":"yajra/laravel-datatables","owner":{"login":"yajra","id":2687997,"avatar_url":"https://avatars.githubusercontent.com/u/2687997?v=3","gravatar_id":"","url":"https://api.github.com/users/yajra","html_url":"https://github.com/yajra","followers_url":"https://api.github.com/users/yajra/followers","following_url":"https://api.github.com/users/yajra/following{/other_user}","gists_url":"https://api.github.com/users/yajra/gists{/gist_id}","starred_url":"https://api.github.com/users/yajra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yajra/subscriptions","organizations_url":"https://api.github.com/users/yajra/orgs","repos_url":"https://api.github.com/users/yajra/repos","events_url":"https://api.github.com/users/yajra/events{/privacy}","received_events_url":"https://api.github.com/users/yajra/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yajra/laravel-datatables","description":"jQuery DataTables API for Laravel 4|5","fork":false,"url":"https://api.github.com/repos/yajra/laravel-datatables","forks_url":"https://api.github.com/repos/yajra/laravel-datatables/forks","keys_url":"https://api.github.com/repos/yajra/laravel-datatables/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yajra/laravel-datatables/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yajra/laravel-datatables/teams","hooks_url":"https://api.github.com/repos/yajra/laravel-datatables/hooks","issue_events_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/events{/number}","events_url":"https://api.github.com/repos/yajra/laravel-datatables/events","assignees_url":"https://api.github.com/repos/yajra/laravel-datatables/assignees{/user}","branches_url":"https://api.github.com/repos/yajra/laravel-datatables/branches{/branch}","tags_url":"https://api.github.com/repos/yajra/laravel-datatables/tags","blobs_url":"https://api.github.com/repos/yajra/laravel-datatables/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yajra/laravel-datatables/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yajra/laravel-datatables/git/refs{/sha}","trees_url":"https://api.github.com/repos/yajra/laravel-datatables/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yajra/laravel-datatables/statuses/{sha}","languages_url":"https://api.github.com/repos/yajra/laravel-datatables/languages","stargazers_url":"https://api.github.com/repos/yajra/laravel-datatables/stargazers","contributors_url":"https://api.github.com/repos/yajra/laravel-datatables/contributors","subscribers_url":"https://api.github.com/repos/yajra/laravel-datatables/subscribers","subscription_url":"https://api.github.com/repos/yajra/laravel-datatables/subscription","commits_url":"https://api.github.com/repos/yajra/laravel-datatables/commits{/sha}","git_commits_url":"https://api.github.com/repos/yajra/laravel-datatables/git/commits{/sha}","comments_url":"https://api.github.com/repos/yajra/laravel-datatables/comments{/number}","issue_comment_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/comments{/number}","contents_url":"https://api.github.com/repos/yajra/laravel-datatables/contents/{+path}","compare_url":"https://api.github.com/repos/yajra/laravel-datatables/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yajra/laravel-datatables/merges","archive_url":"https://api.github.com/repos/yajra/laravel-datatables/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yajra/laravel-datatables/downloads","issues_url":"https://api.github.com/repos/yajra/laravel-datatables/issues{/number}","pulls_url":"https://api.github.com/repos/yajra/laravel-datatables/pulls{/number}","milestones_url":"https://api.github.com/repos/yajra/laravel-datatables/milestones{/number}","notifications_url":"https://api.github.com/repos/yajra/laravel-datatables/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yajra/laravel-datatables/labels{/name}","releases_url":"https://api.github.com/repos/yajra/laravel-datatables/releases{/id}","deployments_url":"https://api.github.com/repos/yajra/laravel-datatables/deployments","created_at":"2013-11-27T02:31:18Z","updated_at":"2016-09-23T14:08:13Z","pushed_at":"2016-09-23T21:35:25Z","git_url":"git://github.com/yajra/laravel-datatables.git","ssh_url":"git@github.com:yajra/laravel-datatables.git","clone_url":"https://github.com/yajra/laravel-datatables.git","svn_url":"https://github.com/yajra/laravel-datatables","homepage":"http://datatables.yajrabox.com/","size":2162,"stargazers_count":907,"watchers_count":907,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":212,"mirror_url":null,"open_issues_count":54,"forks":212,"open_issues":54,"watchers":907,"default_branch":"6.0"}},"_links":{"self":{"href":"https://api.github.com/repos/yajra/laravel-datatables/pulls/765"},"html":{"href":"https://github.com/yajra/laravel-datatables/pull/765"},"issue":{"href":"https://api.github.com/repos/yajra/laravel-datatables/issues/765"},"comments":{"href":"https://api.github.com/repos/yajra/laravel-datatables/issues/765/comments"},"review_comments":{"href":"https://api.github.com/repos/yajra/laravel-datatables/pulls/765/comments"},"review_comment":{"href":"https://api.github.com/repos/yajra/laravel-datatables/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yajra/laravel-datatables/pulls/765/commits"},"statuses":{"href":"https://api.github.com/repos/yajra/laravel-datatables/statuses/2eb45ce9114f047b5fff27891248fd8ded22647c"}}}}
{"actor":{"display_login":"yajra"}}