s .regex()

Description:

Match a string with the regular expression.

Syntax:

s.regex(rs)

Note:

The function matches string s with the regular expression rs, and returns an array of sections of matching data. If they don’t match, then return null.

Parameters:

s

A string

rs

Regular expression

Options:

@c

Case insensitive

@u

Use Unicode to match

Return value:

An array of sections of data

Example:

 

A

 

1

4,23,a,test

 

2

a,D

 

3

W,F

 

4

=A1.regex("(\\d),([0-9]*),([a-z]),([a-z]*)")

5

=A2.regex@c("([a-z]),([a-z])")

With @c option, it is case insensitive

6

=A2.regex("([a-z]),([a-z])")

Return null because they don’t match

7

=A3.regex@u("(\\u0057),(\\u0046)")

[W,F] Use unicode to match

Related functions:

A.regex()

cs.regex()