{"name":"verbal-expressions","description":"JavaScript Regular expressions made easy","version":"0.1.0","keywords":["regular expressions","regex"],"devDependencies":{"grunt-contrib-qunit":"~0.2.2"},"repository":{"type":"git","url":"git://github.com/jehna/VerbalExpressions.git"},"bugs":{"url":"https://github.com/jehna/VerbalExpressions/issues"},"main":"VerbalExpressions.js","license":"MIT","engines":{"node":">= 0.8.0"},"_id":"verbal-expressions@0.1.0","dist":{"shasum":"3f62a34390014f80984e1db94164fd928acdd78e","tarball":"http://registry-npm.ywwl.com/verbal-expressions/download/verbal-expressions-0.1.0.tgz","integrity":"sha512-iGjzvzjLoWc5xmmXHw9DpIgJb63+cVf5WPgGKgaTreqMA/2wMFIqAc3yYfmqGUJz7En+IudX2fDpABtPkJ02MA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE2DYcu3BHOpd177RaHyUkI10+NqdLt9esVTpcZZUd8YAiBtq3/hRuYgX6nl24qsxd1JY45RZl/bF3vlZyCgCzJdwQ=="}],"size":23912,"noattachment":false,"key":"/verbal-expressions/-/verbal-expressions-0.1.0.tgz"},"_from":".","_npmVersion":"1.2.25","_npmUser":{"name":"verbalexpressions","email":"oleg.b.seletsky@gmail.com"},"maintainers":[{"name":"verbalexpressions","email":"oleg.b.seletsky@gmail.com"}],"directories":{},"readme":"# VerbalExpressions\r\n\r\n[![Build Status](https://travis-ci.org/VerbalExpressions/JSVerbalExpressions.svg)](https://travis-ci.org/VerbalExpressions/JSVerbalExpressions)\r\n[![Latest Version](https://img.shields.io/npm/v/verbal-expressions.svg)](https://www.npmjs.com/package/verbal-expressions)\r\n[![jsDelivr](https://img.shields.io/badge/dynamic/json.svg?label=jsDelivr&url=https%3A%2F%2Fdata.jsdelivr.com%2Fv1%2Fpackage%2Fnpm%2Fverbal-expressions&query=%24..tags.latest&colorB=blue&prefix=v)](https://www.jsdelivr.com/package/npm/verbal-expressions)\r\n[![License](https://img.shields.io/github/license/VerbalExpressions/JSVerbalExpressions.svg)](LICENSE)\r\n\r\n## JavaScript Regular Expressions made easy\r\n\r\nVerbalExpressions is a JavaScript library that helps construct difficult regular expressions.\r\n\r\n## How to get started\r\n\r\n### In the browser\r\n\r\n```html\r\n<script src=\"VerbalExpressions.js\"></script>\r\n```\r\n\r\nOr use the [jsDelivr CDN](https://www.jsdelivr.com/package/npm/verbal-expressions).\r\n\r\n### On the server (node.js)\r\n\r\nInstall:\r\n\r\n```sh\r\nnpm install verbal-expressions\r\n```\r\n\r\nRequire:\r\n\r\n```js\r\nconst VerEx = require('verbal-expressions');\r\n```\r\n\r\nOr use ES6's `import`:\r\n\r\n```js\r\nimport VerEx from 'verbal-expressions';\r\n```\r\n\r\n## Running tests\r\n\r\n```sh\r\nnpm test\r\n```\r\n\r\n(or)\r\n\r\n```sh\r\nnpm run test:verbose\r\n```\r\n\r\n## Creating a minified version\r\n\r\n```sh\r\nnpm run build\r\n```\r\n\r\nThis will run [Babel](https://babeljs.io) on `VerbalExpressions.js` and output the result to `dist/verbalexpressions.js`. A minified version of the same will also be written to `dist/verbalexpressions.min.js`.\r\n\r\nA source map will also be created in `dist`, so you can use the original \"un-babelified\", unminified source file for debugging purposes.\r\n\r\n## API documentation\r\n\r\nYou can find the API documentation at [verbalexpressions.github.io/JSVerbalExpressions](https://verbalexpressions.github.io/JSVerbalExpressions). You can find the source code for the docs in [`docs`](docs/).\r\n\r\n## Examples\r\n\r\nHere are some simple examples to give an idea of how VerbalExpressions works:\r\n\r\n### Testing if we have a valid URL\r\n\r\n```js\r\n// Create an example of how to test for correctly formed URLs\r\nconst tester = VerEx()\r\n    .startOfLine()\r\n    .then('http')\r\n    .maybe('s')\r\n    .then('://')\r\n    .maybe('www.')\r\n    .anythingBut(' ')\r\n    .endOfLine();\r\n\r\n// Create an example URL\r\nconst testMe = 'https://www.google.com';\r\n\r\n// Use RegExp object's native test() function\r\nif (tester.test(testMe)) {\r\n    alert('We have a correct URL'); // This output will fire\r\n} else {\r\n    alert('The URL is incorrect');\r\n}\r\n\r\nconsole.log(tester); // Outputs the actual expression used: /^(http)(s)?(\\:\\/\\/)(www\\.)?([^\\ ]*)$/\r\n```\r\n\r\n### Replacing strings\r\n\r\n```js\r\n// Create a test string\r\nconst replaceMe = 'Replace bird with a duck';\r\n\r\n// Create an expression that seeks for word \"bird\"\r\nconst expression = VerEx().find('bird');\r\n\r\n// Execute the expression like a normal RegExp object\r\nconst result = expression.replace(replaceMe, 'duck');\r\n\r\n// Outputs \"Replace duck with a duck\"\r\nalert(result);\r\n```\r\n\r\n### Shorthand for string replace\r\n\r\n```js\r\nconst result = VerEx().find('red').replace('We have a red house', 'blue');\r\n\r\n// Outputs \"We have a blue house\"\r\nalert(result);\r\n```\r\n\r\n## Contributions\r\n\r\nPull requests are warmly welcome!\r\n\r\nClone the repo and fork:\r\n\r\n```sh\r\ngit clone https://github.com/VerbalExpressions/JSVerbalExpressions.git\r\n```\r\n\r\n### Style guide\r\n\r\nThe [Airbnb](https://github.com/airbnb/javascript) style guide is loosely used as a basis for creating clean and readable JavaScript code. Check [`.eslintrc`](.eslintrc).\r\n\r\nCheck out these slide decks for handy Github & git tips:\r\n\r\n- [Git and Github Secrets](https://zachholman.com/talk/git-github-secrets/)\r\n- [More Git and Github Secrets](https://zachholman.com/talk/more-git-and-github-secrets/)\r\n\r\n## Tools\r\n\r\n- https://verbalregex.com - it's a wrapper of JSVerbalExpressions; users can write down the code and compile to regex\r\n- https://jsbin.com/metukuzowi/edit?js,console - JSBin Playground\r\n\r\n## Other Implementations\r\n\r\nYou can see an up to date list of all ports on [VerbalExpressions.github.io](https://VerbalExpressions.github.io).\r\n\r\n- [Ruby](https://github.com/ryan-endacott/verbal_expressions)\r\n- [C#](https://github.com/VerbalExpressions/CSharpVerbalExpressions)\r\n- [Python](https://github.com/VerbalExpressions/PythonVerbalExpressions)\r\n- [Java](https://github.com/VerbalExpressions/JavaVerbalExpressions)\r\n- [Groovy](https://github.com/VerbalExpressions/GroovyVerbalExpressions)\r\n- [PHP](https://github.com/VerbalExpressions/PHPVerbalExpressions)\r\n- [Haskell](https://github.com/VerbalExpressions/HaskellVerbalExpressions)\r\n- [Haxe](https://github.com/VerbalExpressions/HaxeVerbalExpressions)\r\n- [C++](https://github.com/VerbalExpressions/CppVerbalExpressions)\r\n- [Objective-C](https://github.com/VerbalExpressions/ObjectiveCVerbalExpressions)\r\n- [Perl](https://github.com/VerbalExpressions/PerlVerbalExpressions)\r\n- [Swift](https://github.com/VerbalExpressions/SwiftVerbalExpressions)\r\n\r\nIf you would like to contribute another port (which would be awesome!), please [open an issue](https://github.com/VerbalExpressions/implementation/issues/new) specifying the language in the [VerbalExpressions/implementation repo](https://github.com/VerbalExpressions/implementation/issues). Please don't open PRs for other languages against this repo.\r\n","publish_time":1374942823085,"_cnpm_publish_time":1374942823085,"dist-tags":{"latest":"1.0.2"}}