Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

regex (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

Owning Class: string

Requires: MathScript RT Module

Syntax

m = regex(a, format)

m = regex(a, format, 'once')

[m, n] = regex(a, format)

[m, n] = regex(a, format, 'once')

Legacy Name: regexp

Description

Performs a case-sensitive search for a regular expression in the input string a and returns the first and last indexes of the matched strings.

Examples

Inputs

Name Description
a Specifies the string to search.
format Specifies the pattern for which you want to search in a. format is case sensitive.
'once' Directs LabVIEW to return the first and last indexes of only the first matched string.

Outputs

Name Description
m Returns the first indexes of all matched strings. If you specify 'once', m returns the first index of the first matched string.
n Returns the last indexes of all matched strings. If you specify 'once', n returns the last index of the first matched string.

Details

The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT Not characterized

Examples

a = 'Run regex in LabVIEW MathScript';
format = 'L[a-zA-Z]+W';
[m, n] = regex(a, format)

Related Topics

regex_convert
regex_i
regex_replace
strfindall


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit