Skip to content

regexpand is a Golang library that provides information about the strings a regular expression matches.

License

Notifications You must be signed in to change notification settings

google/regexpand

Regexpand

Purpose

regexpand is a Golang library that provides information about the strings a regular expression matches.

It can be used to guess type information from regular expessions, turn field validation into dropdowns...

Usage

See godoc for more.

Expand()

const maxOutputLen = 100
res, _ := regexpand.Expand("(?i:p)u[m]p(kin|)s?", maxOutputLen)
fmt.Printf("%+v\n", res)
// Output:
// [Pump Pumpkin Pumpkins Pumps pump pumpkin pumpkins pumps]

ASCIIRange()

res, _ := regexpand.ASCIIRange(`\d+`)
fmt.Println(res)
// Output:
// [0-9]

Legal notice

This is not an officially supported Google product. This project is not eligible for the Google Open Source Software Vulnerability Rewards Program.

About

regexpand is a Golang library that provides information about the strings a regular expression matches.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages