RGJS6 Match module
Methods
-
<static> balanced(str [, open] [, close] [, opts])
-
Get balanced matches.
Inspiration: https://github.com/icodeforlove/balanced.jsParameters:
Name Type Argument Default Description strstring The string to search for matches.
openstring <optional>
'{' The opening character for the match.
closestring <optional>
'}' The closing character for the match.
optsobject <optional>
{} Options are optional.
Returns:
List of matches.
- Type
- array
Example
rgjs.match.balanced('Hello, my name is {name} and I like {what}'); // Returns ['name', 'what'].