{"id":20471235,"url":"https://github.com/tawk/tawk-url-utils","last_synced_at":"2026-03-10T02:01:26.538Z","repository":{"id":44728746,"uuid":"413387633","full_name":"tawk/tawk-url-utils","owner":"tawk","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-13T09:26:23.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-09T00:34:36.323Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tawk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-10-04T11:12:27.000Z","updated_at":"2024-09-09T08:06:57.000Z","dependencies_parsed_at":"2025-05-09T00:42:30.974Z","dependency_job_id":null,"html_url":"https://github.com/tawk/tawk-url-utils","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tawk/tawk-url-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tawk%2Ftawk-url-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tawk%2Ftawk-url-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tawk%2Ftawk-url-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tawk%2Ftawk-url-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tawk","download_url":"https://codeload.github.com/tawk/tawk-url-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tawk%2Ftawk-url-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30322634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T01:36:58.598Z","status":"online","status_checked_at":"2026-03-10T02:00:06.579Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T14:15:31.273Z","updated_at":"2026-03-10T02:01:26.489Z","avatar_url":"https://github.com/tawk.png","language":"PHP","readme":"# Tawk URL Utils Module\n\n## Overview\n\nA tawk.to utility library for URLs.\n\n## Modules\n\n### Url Pattern Matcher\n\nThis module handles matching of the provided URL to the provided patterns.\n\n#### match(string $current_url, array $patterns)\n\nMatches the provided url and patterns. Returns `true` if it matches. Otherwise, `false`.\n\n##### Example\n\n```php\n\u003c?php\nuse Tawk\\Modules\\UrlPatternMatcher;\n\n$current_url = 'http://www.example.com/path/to/somewhere';\n$patterns = array('http://www.example.com/path/to/somewhere');\n\n$match_result = UrlPatternMatcher::match($current_url, $patterns);\n```\n\n### Path Pattern Matcher\n\nThis module handles matching of the provided URL path to the provided patterns by matching them per chunk.\n\n#### match(array $current_path_chunks, array $path_patterns)\n\nMatches the provided url path and patterns. Returns `true` if it matches. Otherwise, `false`.\n\n```php\n\u003c?php\nuse Tawk\\Helpers\\PathHelper;\nuse Tawk\\Models\\PathPattern;\nuse Tawk\\Modules\\PathPatternMatcher;\n\n$current_url = PathHelper::get_chunks('/path/to/somewhere');\n$path_patterns = array(\n\tPathPattern::create_instance_from_path('/path/to/somewhere'),\n);\n\n$match_result = PathPatternMatcher::match($current_url, $path_patterns);\n```\n\n### Additional Info\n\n#### Valid Patterns for Pattern Matchers\n\n- `*`\n- `*/to/somewhere`\n- `/*/to/somewhere`\n- `/path/*/somewhere`\n- `/path/*/lead/*/somewhere`\n- `/path/*/*/somewhere`\n- `/path/to/*`\n- `/path/to/*/`\n- `*/to/*/page`\n- `/*/to/*/page`\n- `/path/*/other/*`\n- `/path/*/other/*/`\n- `http://www.example.com/`\n- `http://www.example.com/*`\n- `http://www.example.com/*/to/somewhere`\n- `http://www.example.com/path/*/somewhere`\n- `http://www.example.com/path/*/lead/*/somewhere`\n- `http://www.example.com/path/*/*/somewhere`\n- `http://www.example.com/path/to/*`\n- `http://www.example.com/path/to/*/`\n- `http://www.example.com/*/to/*/page`\n- `http://www.example.com/path/*/other/*`\n- `http://www.example.com/path/*/other/*/`\n\n#### Invalid Patterns for Pattern Matchers\n\n- `path/*/somewhere` - \"path\" will be considered as a host and not a start of a path.\n- `*/should/*/to/*` - This is currently not supported. Multiple wildcards on the pattern only supports either at `START and MIDDLE` or `MIDDLE and END` of the path.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftawk%2Ftawk-url-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftawk%2Ftawk-url-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftawk%2Ftawk-url-utils/lists"}