An open API service indexing awesome lists of open source software.

https://github.com/stagas/match-to-token

transform a RegExp named group match to a more useful object
https://github.com/stagas/match-to-token

regexp regexp-match

Last synced: 3 months ago
JSON representation

transform a RegExp named group match to a more useful object

Awesome Lists containing this project

README

        


match-to-token

transform a RegExp named group match to a more useful object



npm i match-to-token

pnpm add match-to-token

yarn add match-to-token

## API

# matchToToken(match)

    # match


      null | RegExpMatchArray


    matchToToken(match)  =>



# RegExpToken

    # constructor(pattern)


# Token # is(group, value)

    # group


      string

    # value

      string


    is(group, value)  =>


      boolean
# toJSON() # create(value, group, source) # RegExpMatchArrayLike

    # index


      number

    # input

      string


# TokenJson

    # group


      string

    # source

      {


      # index


        number

      # input

        string

      # match

        string []

      }

# value

    string

# matchToToken(match)

    # match


      null | RegExpMatchArray


    matchToToken(match)  =>


## Contributing

[Fork](https://github.com/stagas/match-to-token/fork) or [edit](https://github.dev/stagas/match-to-token) and submit a PR.

All contributions are welcome!

## License

MIT © 2022 [stagas](https://github.com/stagas)