show_regex: Show regex pattern in a htmlwidget

Description Usage Arguments Details See Also Examples

Description

Show JS-style regex pattern in an htmlwidget.

Usage

1

Arguments

pattern

a pattern string

width

the widget width

height

the widget height

Details

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

See Also

https://regexper.com/documentation.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 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)

re2r documentation built on May 2, 2019, 12:35 p.m.