Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the properties and methods of regular expressions in Flex programming

Shulou Source: shulou.com Published: 2022-06-02 06:26:51 09月10日 Update

This article mainly introduces the attributes and methods of regular expressions in Flex programming. It is very detailed and has a certain reference value. Friends who are interested must read it!

Flex programming-- regular expression

The RegExp class allows the use of regular expressions (that is, patterns that can be used to search for and replace text in strings).

You can create a new RegExp object by using the newRegExp () constructor or by assigning RegExp text to a variable:

Varpattern1:RegExp=newRegExp ("test-\\ d", "I")

Varpattern2:RegExp=/test-\ dplani

Common attributes of regular expressions in Flex programming

Attribute definition party

Constructor:Object

A reference to the constructor of a class object or a given object instance. Object

Dotall:Boolean

◆ specifies the dot character (.) in the regular expression pattern. Whether it matches the newline character. RegExp

Extended:Boolean

◆ specifies whether to use extended mode for regular expressions. RegExp

Global:Boolean

◆ specifies whether global matching is used for regular expressions. RegExp

IgnoreCase:Boolean

◆ specifies whether the regular expression ignores case. RegExp

LastIndex:Number

Specifies the index position in the string to start the next search. RegExp

Multiline:Boolean

◆ specifies whether the m (multiline) flag is set. RegExp

Prototype:Object

◆ 's reference to the prototype object of a class or function object. Object

Source:String

◆ specifies the pattern portion of the regular expression. RegExp

Common methods of regular expressions in Flex programming

Method definition square

◆ RegExp (re:String,flags:String)

Allows you to use two strings to construct regular expressions. RegExp

◆ exec (str:String): Object

Performs a regular expression search in the given string str. RegExp

◆ hasOwnProperty (name:String): Boolean

Indicates whether the specified property has been defined for the object. Object

◆ isPrototypeOf (theClass:Object): Boolean

Indicates whether an instance of the Object class is in the prototype chain of the object specified as a parameter. Object

◆ propertyIsEnumerable (name:String): Boolean

Indicates whether the specified property exists and can be enumerated. Object

◆ setPropertyIsEnumerable (name:String,isEnum:Boolean=true): void

Sets the availability of the dynamic properties of the loop operation. Object

◆ test (str:String): Boolean

Tests whether the regular expression matches in the given string str. RegExp

These are all the contents of the article "what are the properties and methods of regular expressions in Flex programming?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Regular expression attribute object program programming design character string method pattern function indication search content prototype instance text article semantic square Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Tech Info Shulou Technology OPPO Reno MySQL