https://github.com/ryanfarber/delimiter-finder
a utility to find words inside delimiters
https://github.com/ryanfarber/delimiter-finder
Last synced: about 2 months ago
JSON representation
a utility to find words inside delimiters
- Host: GitHub
- URL: https://github.com/ryanfarber/delimiter-finder
- Owner: ryanfarber
- Created: 2020-12-18T10:32:35.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-10T10:22:39.000Z (over 4 years ago)
- Last Synced: 2025-05-09T01:57:14.583Z (about 1 year ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# delimiter-finder
a utility to find words inside delimiters.
---
## usage
create a new object with an array of delimiters.
use `.find()` with a string as the input. it will output an array of matches for each delimiter specified.
```javascript
const DelimiterFinder = require("delimiter-finder")
const delim = new DelimiterFinder(["$", "%"])
let matches = delim.find("hello $world$, how are you %today%")
console.log(matches)
/*
{
'$': [ 'world' ],
'%': [ 'today' ]
}
*/
````