Show regex pattern in a htmlwidget

Usage

show_regex(pattern, width = NULL, height = NULL)

Arguments

pattern
a pattern string
width
the widget width
height
the widget height

Description

Show JS-style regex pattern in an htmlwidget.

Details

Most parts of RE2 regex syntax are supported, except for some special Unicode character classes.

Examples

# Skip on CRAN ## Not run: # # # US ZIP code # # show_regex("[0-9]{5}(?:-[0-9]{4})?") # # # Email # # show_regex("\\b[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}\\b") # # # Hex value # # show_regex("#?([a-f0-9]{6}|[a-f0-9]{3})") # # ## End(Not run)

See also

https://regexper.com/documentation.html