{"id":20836295,"url":"https://github.com/igrigorik/textquery","last_synced_at":"2025-04-07T12:08:40.288Z","repository":{"id":62558848,"uuid":"451465","full_name":"igrigorik/textquery","owner":"igrigorik","description":"Evaluate any text against a collection of match rules","archived":false,"fork":false,"pushed_at":"2013-10-30T05:59:21.000Z","size":297,"stargazers_count":143,"open_issues_count":2,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T11:02:24.310Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/igrigorik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-12-28T21:16:26.000Z","updated_at":"2025-01-22T20:15:13.000Z","dependencies_parsed_at":"2022-11-03T11:15:48.023Z","dependency_job_id":null,"html_url":"https://github.com/igrigorik/textquery","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Ftextquery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Ftextquery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Ftextquery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Ftextquery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igrigorik","download_url":"https://codeload.github.com/igrigorik/textquery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648978,"owners_count":20972945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-18T00:29:24.741Z","updated_at":"2025-04-07T12:08:40.265Z","avatar_url":"https://github.com/igrigorik.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TextQuery\n\nDoes it match? When regular expressions are not enough, textquery is the answer. For\nexample, regular expressions cannot evaluate recursive rules and often result in\noverly verbose and complicated expressions.\n\nTextquery is a simple PEG grammar with support for:\n\n- AND (spaces are implicit AND's)\n- OR\n- NOT (- is an alias)\n- 'quoted strings'\n- fuzzy matching\n- case (in)sensitive\n- attribute tags (e.g. surname:Smith)\n- custom delimiters (default is whitespace for words, : for attributes)\n\nTextQuery in the wild: [PostRank](http://postrank.com/), [PaperTrail](https://papertrailapp.com/), and others!\n\n## Example\n\n```ruby\nTextQuery.new(\"'to be' OR NOT 'to_be'\").match?(\"to be\")   # =\u003e true\n\nTextQuery.new(\"-test\").match?(\"some string of text\")      # =\u003e true\nTextQuery.new(\"NOT test\").match?(\"some string of text\")   # =\u003e true\n\nTextQuery.new(\"a AND b\").match?(\"b a\")                    # =\u003e true\nTextQuery.new(\"a AND b\").match?(\"a c\")                    # =\u003e false\n\nq = TextQuery.new(\"a AND (b AND NOT (c OR d))\")\nq.match?(\"d a b\")                                         # =\u003e false\nq.match?(\"b\")                                             # =\u003e false\nq.match?(\"a b cdefg\")                                     # =\u003e true\n\nTextQuery.new(\"a~\").match?(\"adf\")                         # =\u003e true\nTextQuery.new(\"~a\").match?(\"dfa\")                         # =\u003e true\nTextQuery.new(\"~a~\").match?(\"daf\")                        # =\u003e true\nTextQuery.new(\"2~a~1\").match?(\"edaf\")                     # =\u003e true\nTextQuery.new(\"2~a~2\").match?(\"edaf\")                     # =\u003e false\n\nTextQuery.new(\"a\", :ignorecase =\u003e true).match?(\"A b cD\")  # =\u003e true\n```\n\n\n\n## License\n\nThe MIT License - Copyright (c) 2011 Ilya Grigorik\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figrigorik%2Ftextquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figrigorik%2Ftextquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figrigorik%2Ftextquery/lists"}