Views:

Description

Returns a string which is the 'string' but replaces all regex matches of 'regextofind' with 'regextoreplace'.

Signature

RegexReplace('string', «regextofind», «regextoreplace»)

Example

RegexReplace('0123456789', «(\d{3})(\d{3})(\d{4})», «($1) $2-$3») Returns (012) 345 6789

Description:

Removes all digits from a string

Signature:

RegexReplace('stringinput', «\d», '')

Description:

Removes all characters from a string to only leave digits

Signature:

RegexReplace('stringinput', «\D», '')

Description:

Removes duplicate white space (tabs, newlines, spaces, etc,) from a string

Signature:

RegexReplace('stringinput', «\s+», ' ')

Description:

Removes all ascii characters from a string

Signature:

RegexReplace('stringinput', «[^\u0000-\u007F]», '')

Description:

Removes all ascii characters and ascii control characters from a string

Signature:

RegexReplace('stringinput', «[^\u0020-\u007F]», '')

Description:

Removes everything except alpahnumeric ascii characters from a string

Signature:

RegexReplace('stringinput', «[^A-Za-z0-9]», '')

Description:

Removes all non-alphanumeric charcters except @, - (a dash), . (a period)

Signature:

RegexReplace('stringinput', «[^\w\.@-]», '')

Description:

Formats a US telephone number

Signature:

RegexReplace('US telephone number', «(\d{3})(\d{3})(\d{4})», «($1) $2-$3»)

Description:

Formats a US telephone number with extensions

Signature:

RegexReplace('US telephone number', «^\D*(\d)\D*(\d)\D*(\d)\D*(\d)\D*(\d)\D*(\d)\D*(\d)\D*(\d)\D*(\d)\D*(\d)\D*(\d{2,})$», «+1 ($1$2$3) $4$5$6-$7$8$9$10 Ext $11»)

Parameters

Name Type Description Required
string xxxx xxxx xxxx
«regextofind» xxxx xxxx xxxx
«regextoreplace» xxxx xxxx xxxx

Notes: