{"id":22295985,"url":"https://github.com/jribbens/verbose-regexp","last_synced_at":"2025-07-17T13:34:35.032Z","repository":{"id":40540568,"uuid":"370466867","full_name":"jribbens/verbose-regexp","owner":"jribbens","description":"Verbose Regular Expressions","archived":false,"fork":false,"pushed_at":"2023-06-04T16:04:07.000Z","size":214,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-29T15:40:42.817Z","etag":null,"topics":["javascript","regex","regexp","regular-expression"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jribbens.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2021-05-24T19:43:17.000Z","updated_at":"2025-05-08T05:43:09.000Z","dependencies_parsed_at":"2024-12-03T17:44:35.978Z","dependency_job_id":"fad84ecb-4455-4374-8546-ab0e2179eece","html_url":"https://github.com/jribbens/verbose-regexp","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jribbens/verbose-regexp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jribbens%2Fverbose-regexp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jribbens%2Fverbose-regexp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jribbens%2Fverbose-regexp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jribbens%2Fverbose-regexp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jribbens","download_url":"https://codeload.github.com/jribbens/verbose-regexp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jribbens%2Fverbose-regexp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265611385,"owners_count":23797878,"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":["javascript","regex","regexp","regular-expression"],"created_at":"2024-12-03T17:43:47.388Z","updated_at":"2025-07-17T13:34:35.015Z","avatar_url":"https://github.com/jribbens.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# verbose-regexp\n\nThis module provides a way to use verbose regular expressions in\nJavaScript and TypeScript, similar to `re.VERBOSE` in Python. It\nprovides that white-space at the start and end of lines are ignored,\nas are newlines, and anything following `//` to the end of the line.\n\nIt allows you to easily write multi-line regular expressions, and to\nmake your regular expressions more self-documenting using formatting\nand comments.\n\nExample:\n\n```javascript\n    import { rx } from 'verbose-regexp'\n    // or: const { rx } = require('verbose-regexp')\n\n    const dateTime = rx`\n      (\\d{4}-\\d{2}-\\d{2}) // date\n      T                   // time separator\n      (\\d{2}:\\d{2}:\\d{2}) // time\n    `\n    console.log(dateTime.exec(new Date().toISOString()))\n```\n\nYou can also embed regular expressions within each other, to allow a\ncomplicated regular expression to be built up in steps from simpler parts,\ne.g.:\n\n```javascript\n    const date = rx`\\d{4}-\\d{2}-\\d{2}`\n    const time = rx`\\d{2}:\\d{2}:\\d{2}`\n    const dateTime = rx`\n      (${date})           // date\n      T                   // time separator\n      (${time})           // time\n    `\n    console.log(dateTime.exec(new Date().toISOString()))\n```\n\nNote that embedded sub-expressions are automatically surrounded with `(?:`\nand `)`, so that they are always treated as a self-contained unit. Also note\nthat embedded sub-expressions will be run using the flags of the parent\nexpression, regardless of what flags were on the sub-expression - so, for\nexample, if the sub-expression had the 'case insensitive' flag set but the\nparent expression didn't, then the sub-expression will be executed in a\ncase sensitive manner.\n\nYou can use regular expression flags by accessing them as a property of `rx`,\ne.g.:\n\n```javascript\n    const alpha = rx.i`[a-z]+`\n    const allAlpha = rx.gi`[a-z]+`\n```\n\nIf you want to use a string that would otherwise be ignored (i.e. whitespace\nor `//`), you can simply escape it with backslashes or a character class:\n\n```javascript\n    const url = rx.i`\n      [ ]*([a-z]+):\\/\\/  // scheme\n      ([^/]+)           // location\n      (?:/(.*))         // path\n    `\n```\n\n## History\n\n### 3.0.0 (2023-06-04)\n\n  * Allow embedding of other RegExp objects.\n\n### 2.0.0 (2022-05-03)\n\n  * Use 'Proxy' objects to avoid having to create static properties for\n    every permutation of the possible flags.\n\n### 1.0.0 (2021-05-24)\n\n  * Initial release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjribbens%2Fverbose-regexp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjribbens%2Fverbose-regexp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjribbens%2Fverbose-regexp/lists"}