| [9af201e] | 1 | <!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 | # regex-parser
|
|---|
| 21 |
|
|---|
| 22 | [![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [](https://github.com/IonicaBizau/ama) [](https://www.npmjs.com/package/regex-parser) [](https://www.npmjs.com/package/regex-parser) [](https://www.codementor.io/@johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
|
|---|
| 23 |
|
|---|
| 24 | <a href="https://www.buymeacoffee.com/H96WwChMy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 | > A module that parses a string as regular expression and returns the parsed value.
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 | ## :cloud: Installation
|
|---|
| 51 |
|
|---|
| 52 | ```sh
|
|---|
| 53 | # Using npm
|
|---|
| 54 | npm install --save regex-parser
|
|---|
| 55 |
|
|---|
| 56 | # Using yarn
|
|---|
| 57 | yarn add regex-parser
|
|---|
| 58 | ```
|
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 | ## :clipboard: Example
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 | ```js
|
|---|
| 77 | // Dependencies
|
|---|
| 78 | var RegexParser = require("regex-parser");
|
|---|
| 79 |
|
|---|
| 80 | console.log(RegexParser("/^hi$/g"));
|
|---|
| 81 | // => /^hi$/g
|
|---|
| 82 | ```
|
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 |
|
|---|
| 93 |
|
|---|
| 94 |
|
|---|
| 95 | ## :question: Get Help
|
|---|
| 96 |
|
|---|
| 97 | There are few ways to get help:
|
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 | 1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
|
|---|
| 102 | 2. For bug reports and feature requests, open issues. :bug:
|
|---|
| 103 | 3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 | ## :memo: Documentation
|
|---|
| 112 |
|
|---|
| 113 |
|
|---|
| 114 | ### `RegexParser(input)`
|
|---|
| 115 | Parses a string input.
|
|---|
| 116 |
|
|---|
| 117 | #### Params
|
|---|
| 118 |
|
|---|
| 119 | - **String** `input`: The string input that should be parsed as regular expression.
|
|---|
| 120 |
|
|---|
| 121 | #### Return
|
|---|
| 122 | - **RegExp** The parsed regular expression.
|
|---|
| 123 |
|
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 | ## :yum: How to contribute
|
|---|
| 138 | Have an idea? Found a bug? See [how to contribute][contributing].
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 | ## :sparkling_heart: Support my projects
|
|---|
| 142 | I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
|
|---|
| 143 | this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
|
|---|
| 144 |
|
|---|
| 145 | However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
|
|---|
| 146 |
|
|---|
| 147 |
|
|---|
| 148 | - Starring and sharing the projects you like :rocket:
|
|---|
| 149 | - [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
|
|---|
| 150 | - [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
|
|---|
| 151 | - [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
|
|---|
| 152 | - **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
|
|---|
| 153 |
|
|---|
| 154 | 
|
|---|
| 155 |
|
|---|
| 156 |
|
|---|
| 157 | Thanks! :heart:
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 |
|
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
|
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
|
|---|
| 176 |
|
|---|
| 177 |
|
|---|
| 178 |
|
|---|
| 179 |
|
|---|
| 180 |
|
|---|
| 181 |
|
|---|
| 182 | ## :scroll: License
|
|---|
| 183 |
|
|---|
| 184 | [MIT][license] © [Ionică Bizău][website]
|
|---|
| 185 |
|
|---|
| 186 |
|
|---|
| 187 |
|
|---|
| 188 |
|
|---|
| 189 |
|
|---|
| 190 |
|
|---|
| 191 | [license]: /LICENSE
|
|---|
| 192 | [website]: https://ionicabizau.net
|
|---|
| 193 | [contributing]: /CONTRIBUTING.md
|
|---|
| 194 | [docs]: /DOCUMENTATION.md
|
|---|
| 195 | [badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
|
|---|
| 196 | [badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
|
|---|
| 197 | [badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
|
|---|
| 198 | [badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
|
|---|
| 199 | [patreon]: https://www.patreon.com/ionicabizau
|
|---|
| 200 | [amazon]: http://amzn.eu/hRo9sIZ
|
|---|
| 201 | [paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
|
|---|