{"id":21074772,"url":"https://github.com/dawsbot/regs","last_synced_at":"2026-02-26T23:01:42.938Z","repository":{"id":57352498,"uuid":"54518941","full_name":"dawsbot/regs","owner":"dawsbot","description":"Useful regular expressions for JavaScript","archived":false,"fork":false,"pushed_at":"2019-04-19T11:31:10.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-03T05:00:09.723Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dawsbot.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-23T00:42:21.000Z","updated_at":"2019-04-19T11:31:08.000Z","dependencies_parsed_at":"2022-09-11T21:53:30.960Z","dependency_job_id":null,"html_url":"https://github.com/dawsbot/regs","commit_stats":null,"previous_names":["dawsonbotsford/regs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dawsbot/regs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Fregs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Fregs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Fregs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Fregs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dawsbot","download_url":"https://codeload.github.com/dawsbot/regs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Fregs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29876340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T22:37:10.609Z","status":"ssl_error","status_checked_at":"2026-02-26T22:37:09.019Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-19T19:17:51.962Z","updated_at":"2026-02-26T23:01:42.919Z","avatar_url":"https://github.com/dawsbot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# regs\n[![npm version](https://img.shields.io/npm/v/regs.svg)](https://www.npmjs.com/package/regs)\n[![npm download count](http://img.shields.io/npm/dm/regs.svg?style=flat)](http://npmjs.org/regs)\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n\n  \u003ctable\u003e\n    \u003cthead\u003e\n      \u003ctr\u003e\n        \u003cth\u003eLinux \u0026 OSX\u003c/th\u003e\n        \u003cth\u003eWindows\u003c/th\u003e\n      \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n      \u003ctr\u003e\n        \u003ctd align=\"center\"\u003e\n          \u003ca href=\"https://travis-ci.org/dawsbot/regs\"\u003e\u003cimg src=\"https://api.travis-ci.org/dawsbot/regs.svg?branch=master\"\u003e\u003c/a\u003e\n        \u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\n          \u003ca href=\"https://ci.appveyor.com/project/dawsonbotsford/regs\"\u003e\u003cimg src=\"https://ci.appveyor.com/api/projects/status/36mom3aoarhi72jx?svg=true\"\u003e\u003c/a\u003e\n        \u003c/td\u003e\n      \u003c/tr\u003e\n    \u003c/tbody\u003e\n  \u003c/table\u003e\n\n\u003e Useful regular expressions for JavaScript\n\n\u003cbr\u003e\n\n## Install\n\n```\nnpm install --save regs\n```\n\n\u003cbr\u003e\n\n## Usage\n\n#### Node\n\n```js\nconst regs = require('regs');\n\nregs.email().test('me@gmail.com');\n//=\u003e true\n\nregs.yeoman().exec('\u003c% var1 %\u003e')[1]\n//=\u003e 'var1'\n```\n\n\u003cbr\u003e\n\n#### Web\n\n```html\n\u003cscript src=\"https://rawgit.com/dawsonbotsford/regs/master/bundle.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  alert(regs.trim().exec(' var1 ')[1]);\n  //=\u003e 'var1'\n\u003c/script\u003e\n```\n\n\u003cbr\u003e\n\n## Supported regexp types\n\n* \u003ca href=\"#regsyeomanregexpflags\"\u003eyeoman\u003c/a\u003e (`regs.yeoman()`)\n* \u003ca href=\"#regstrimregexpflags\"\u003etrim\u003c/a\u003e (`regs.trim()`)\n* \u003ca href=\"#regsemailregexpflags\"\u003eemail\u003c/a\u003e (`regs.email()`)\n* \u003ca href=\"#regsgithubissueregexpflags\"\u003egithubIssue\u003c/a\u003e (`regs.githubIssue()`)\n* \u003ca href=\"#regsmarkdownheaderregexpflags\"\u003emarkdownHeader\u003c/a\u003e (`regs.markdownHeader()`)\n\n\u003cbr\u003e\n\n## API\n\n* Each function call returns a `RegExp object` which can then operate on/with.\n\n* Each function call supports (*optionally*) the [official RegExp flags](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) which alter behavior of the search. (ex: 'g' for global or 'i' to ignore case)\n\n\u003cbr\u003e\n\n### regs.yeoman([RegExpFlags])\n\nCapture text between `\u003c% %\u003e` or `\u003c%= %\u003e`.\n\n`1` capture group - the value between delimeters.\n\nExample:\n\n```js\nregs.yeoman().exec('\u003c% capture this %\u003e')[1];\n//=\u003e 'capture this'\n```\n\n\u003cbr\u003e\n\n### regs.trim([RegExpFlags])\n\nCapture text without surrounding spaces.\n\n`1` capture group - the value between starting and ending spaces.\n\nExample:\n\n```js\nregs.trim().exec(' var1 ')[1];\n//=\u003e 'var1'\n```\n\n\u003cbr\u003e\n\n### regs.email([RegExpFlags])\n\nCapture all three parts of an email address. Example:\n\n`3` capture groups -\n\n1. Name (before `@`)\n2. Domain body (between `@` and `.`)\n3. Domain suffix (`com`, `io`, etc.)\n\nExample:\n\n```js\n// Simple validation\nregs.email().test('name@domain.suffix');\n//=\u003e true\n\n// Capture all parts\nregs.email().exec('hi@me.io');\n//=\u003e [ 'hi@me.io', 'hi', 'me', 'io', index: 0, input: 'hi@me.io' ]\n```\n\n\u003cbr\u003e\n\n### regs.githubIssue([RegExpFlags])\n\nCapture number following a pound (GitHub issue reference)\n\n`1` capture group - The numeric value of the issue\n\nExample:\n\n```js\nregs.githubIssue().exec('#98')[1];\n//=\u003e '98'\n```\n\n\u003cbr\u003e\n\n### regs.markdownHeader(headerNumber [, RegExpFlags])\n\nCapture text following a markdown header pound (`#`)\n\n`1` capture group - Text following the header\n\n`headerNumber` examples:\n\n* An `h1` in markdown is `# \u003ctext\u003e`, and the `headerNumber` should be set to 1\n* An `h3` in markdown is `### \u003ctext\u003e`, and the `headerNumber` should be set to 3\n\nExample:\n\n```js\nregs.markdownHeader(1).exec('# my header 1')[1];\n//=\u003e 'my header 1'\n\nregs.markdownHeader(4).exec('#### my header 4')[1];\n//=\u003e 'my header 4'\n```\n\n\u003cbr\u003e\n\n## Similar\n\n* [Big list of JavaScript Regular Expressions](https://regex101.com/#javascript)\n* [Perl and PHP Regular Expressions](https://gist.github.com/nerdsrescueme/1237767)\n\n\u003cbr\u003e\n\n## License\n\nMIT © [Dawson Botsford](http://dawsonbotsford.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawsbot%2Fregs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdawsbot%2Fregs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawsbot%2Fregs/lists"}