Module: rgjs/match

RGJS6 Match module

Methods


<static> balanced(str [, open] [, close] [, opts])

Get balanced matches.
Inspiration: https://github.com/icodeforlove/balanced.js

Parameters:
Name Type Argument Default Description
str string

The string to search for matches.

open string <optional>
'{'

The opening character for the match.

close string <optional>
'}'

The closing character for the match.

opts object <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'].