regex_convert (MathScript RT Module Function)

LabVIEW 2012 MathScript RT模块帮助

版本日期:June 2012

产品编号:373123C-0118

»查看产品信息
下载帮助
(仅限Windows)

Owning Class: string

Requires: MathScript RT Module

Syntax

a = regex_convert(option, format)

Legacy Name: regexptranslate

Description

Converts a string to a regular expression to use with the regex function, the regex_i function, or the regex_replace function.

Examples

Inputs

Name Description
option Specifies how to convert the string to a regular expression. option is a string that accepts the following values.

'escape' Inserts an escape character ('\') before the special character.
'wildcard' Converts the wildcard to a regular expression. LabVIEW replaces '*' with '\S+', '?' with '.', and '.' with '\.'.
format Specifies the pattern to convert to a regular expression.

Outputs

Name Description
a Returns the regular expression.

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

a1 = regex_convert('wildcard', '*')
a2 = regex_convert('escape', '\n')
a3 = regex('a.txt, b.doc, cd.xls, 223.vi, 89.txt', regex_convert('wildcard', '*.txt'))
a4 = regex_convert('wildcard', '*.txt')

Related Topics

regex
regex_i
regex_replace

文章是否对您有帮助?

没有帮助