{"id":16588108,"url":"https://github.com/imax153/expressive-ts","last_synced_at":"2025-04-21T15:30:44.386Z","repository":{"id":40754663,"uuid":"285087363","full_name":"IMax153/expressive-ts","owner":"IMax153","description":"A functional programming library designed to simplify building complex regular expressions","archived":false,"fork":false,"pushed_at":"2023-01-07T20:44:39.000Z","size":2792,"stargazers_count":92,"open_issues_count":14,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T17:52:36.324Z","etag":null,"topics":["functional-programming","javascript","regex","regular-expressions","typescript"],"latest_commit_sha":null,"homepage":"https://imax153.github.io/expressive-ts/","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/IMax153.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-04T20:04:10.000Z","updated_at":"2025-04-14T04:53:35.000Z","dependencies_parsed_at":"2023-02-08T01:30:26.806Z","dependency_job_id":null,"html_url":"https://github.com/IMax153/expressive-ts","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/IMax153%2Fexpressive-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMax153%2Fexpressive-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMax153%2Fexpressive-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IMax153%2Fexpressive-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IMax153","download_url":"https://codeload.github.com/IMax153/expressive-ts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250080492,"owners_count":21371516,"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":["functional-programming","javascript","regex","regular-expressions","typescript"],"created_at":"2024-10-11T22:55:53.127Z","updated_at":"2025-04-21T15:30:42.734Z","avatar_url":"https://github.com/IMax153.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Expressive-ts Logo](./assets/logo.png)\n\n![Build Status Badge](https://github.com/IMax153/expressive-ts/workflows/Build/badge.svg)\n\n\u003e `expressive-ts` is a functional programming library designed to simplify building complex regular expressions.\n\n# Expressive-ts\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of contents**\n\n- [Installation](#installation)\n- [Why?](#why)\n- [Usage](#usage)\n- [Documentation](#documentation)\n- [Prior Art](#prior-art)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Installation\n\n```\nnpm install fp-ts expressive-ts\n```\n\nor\n\n```\nyarn add fp-ts expressive-ts\n```\n\n**Note**: `fp-ts` is a peer dependency of `expressive-ts`\n\n## Why?\n\nThe expressive nature of the `expressive-ts` API makes it incredibly easy to understand the purpose of an otherwise cryptic regular expression. Function composition is a core component of the API. By composing together the various functions provided by `expressive-ts`, extremely complex regular expressions can be built easily.\n\n## Usage\n\nLets imagine that we would like to recognize and validate a basic URL. Here's how it would look using `expressive-ts`.\n\n```typescript\nimport { pipe } from 'fp-ts/lib/function'\nimport * as E from 'expressive-ts/lib/Expression'\n\nconst expression = pipe(\n  E.compile, // expressions always begin with a call to `compile`\n  E.startOfInput,\n  E.string('http'),\n  E.maybe('s'),\n  E.string('://'),\n  E.maybe('www.'),\n  E.anythingBut(' '),\n  E.endOfInput,\n  E.toRegex\n)\n\nassert.strictEqual(expression.test('https://www.google.com'), true)\nassert.strictEqual(expression.test('https://google.com'), true)\nassert.strictEqual(expression.test('http://google.com'), true)\nassert.strictEqual(expression.test('http:/google.com'), false)\nassert.strictEqual(expression.test('http://goog le.com'), false)\n```\n\n## Documentation\n\n- [Docs](https://imax153.github.io/expressive-ts/)\n\n## Prior Art\n\n- [Super Expressive](https://github.com/francisrstokes/super-expressive/) (@francisrstokes)\n- [Verbal Expressions](https://github.com/VerbalExpressions/JSVerbalExpressions/) (@VerbalExpressions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimax153%2Fexpressive-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimax153%2Fexpressive-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimax153%2Fexpressive-ts/lists"}