{"id":13747381,"url":"https://github.com/talyssonoc/CommonRegexRuby","last_synced_at":"2025-05-09T08:32:34.495Z","repository":{"id":26284349,"uuid":"29731930","full_name":"talyssonoc/CommonRegexRuby","owner":"talyssonoc","description":"Find a lot of kinds of common information in a string. CommonRegex port for Ruby","archived":false,"fork":false,"pushed_at":"2021-11-29T10:41:12.000Z","size":173,"stargazers_count":80,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T21:37:02.094Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/talyssonoc.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":"2015-01-23T12:39:05.000Z","updated_at":"2025-02-11T19:04:07.000Z","dependencies_parsed_at":"2022-08-26T20:22:54.834Z","dependency_job_id":null,"html_url":"https://github.com/talyssonoc/CommonRegexRuby","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talyssonoc%2FCommonRegexRuby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talyssonoc%2FCommonRegexRuby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talyssonoc%2FCommonRegexRuby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talyssonoc%2FCommonRegexRuby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/talyssonoc","download_url":"https://codeload.github.com/talyssonoc/CommonRegexRuby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253217168,"owners_count":21873026,"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-08-03T06:01:26.970Z","updated_at":"2025-05-09T08:32:34.162Z","avatar_url":"https://github.com/talyssonoc.png","language":"Ruby","readme":"CommonRegexRuby\n=============\n\n[![Gem Version](https://badge.fury.io/rb/commonregex.svg)](http://badge.fury.io/rb/commonregex) \n[![Build Status](https://travis-ci.org/talyssonoc/CommonRegexRuby.svg?branch=master)](https://travis-ci.org/talyssonoc/CommonRegexRuby)\n\n[CommonRegex](https://github.com/madisonmay/CommonRegex/ \"CommonRegex\") port for Ruby\n\nFind a lot of kinds of common information in a string.\n\nPull requests welcome!\n\nPlease note that this is currently English/US specific.\n\nInstallation\n============\n\nTo install CommonRegexRuby, just run:\n\n```sh\n    $ gem install commonregex\n```\n\nNow you're able to use the `CommonRegex` class, check the API and the examples.\n\nAPI\n===\n\nInstance methods will return the results relative to the text passed at the constructor.\nClass methods will receive a text as parameter and return the results relative to it.\n\nPossible instance and class methods:\n\n* `get_dates([text])`\n* `get_times([text])`\n* `get_phones([text])`\n* `get_links([text])`\n* `get_emails([text])`\n* `get_ipv4([text])`\n* `get_ipv6([text])`\n* `get_hex_colors([text])`\n* `get_acronyms([text])`\n* `get_money([text])`\n* `get_percentages([text])` (matches percentages between 0.00% and 100.00%)\n* `get_credit_cards([text])`\n* `get_addresses([text])`\n\nExamples\n========\n\n```ruby\n    text = \"John, please get that article on www.linkedin.com to me by 5:00PM\\n\"\n    \"on Jan 9th 2012. 4:00 would be ideal, actually. If you have any questions,\\n\"\n    \"you can reach my associate at (012)-345-6789 or associative@mail.com.\\n\"\n    \"I\\'ll be on UK during the whole week on a J.R.R. Tolkien convention.\"\n    \n    common_regex = CommonRegex.new(text)\n    put common_regex.get_dates\n    // [\"Jan 9th 2012\"]\n    puts common_regex.get_times\n    // [\"5:00PM\", \"4:00\"]\n    puts common_regex.get_phones\n    // [\"(012)-345-6789\"]\n    puts common_regex.get_links\n    // [\"www.linkedin.com\"]\n    puts common_regex.get_emails\n    // [\"associative@mail.com\"]\n    puts common_regex.get_acronyms\n    // [\"UK\", \"J.R.R.\"]\n\n```\n\nAlternatively, you can use class methods.\n\n```ruby\n\n    puts CommonRegex.get_times 'When are you free? Do you want to meet up for coffee at 4:00?'\n    // [\"4:00\"]\n    puts CommonRegex.get_money 'They said the price was US$5,000.90, actually it is US$3,900.5. It\\'s $1100.4 less, can you imagine this?'\n    // [\"US$5,000.90\", \"US$3,900.5\", \"$1100.4\"]\n    puts CommonRegex.get_percentages 'I\\'m 99.9999999% sure that I\\'ll get a raise of 5%.'\n    // [\"99.9999999%\", \"5%\"]\n    puts CommonRegex.get_ipv6 'The IPv6 address for localhost is 0:0:0:0:0:0:0:1, or alternatively, ::1.'\n    // [\"0:0:0:0:0:0:0:1\", \"::1\"]\n\n```\n\nCommonRegex Ports\n=================\nThere are CommonRegex ports for other languages, see [here](https://github.com/madisonmay/CommonRegex/#commonregex-ports \"CommonRegex ports\")\n","funding_links":[],"categories":["Ruby","Language Aware String Manipulation"],"sub_categories":["Text-to-Speech-to-Text"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalyssonoc%2FCommonRegexRuby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftalyssonoc%2FCommonRegexRuby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalyssonoc%2FCommonRegexRuby/lists"}