How to enable a filter with regular expression with DXL

Hi folks,

I'm trying to write some DXL code to view the objects after applying with filters in current module. The filter contains regular expression. I searched in DXL manual and found a function: Filter contains(attribute(string attributeName)), string text, [bool caseSensitive, bool useRegExp]), there is also a sample
+Module m = current
Filter f = contains(attribute "Object Text", "shall", false)
set f
filtering on+
But I had no idea how to use regular expression.

For example, if I only hope to view the objects, which object heading attribute contains test+a-zA-Z (+a-zA-Z is a regular expression), how can I write the DXL code?

Thanks & Regards
Edward
Edward_Wang - Thu Jun 09 04:14:44 EDT 2011

Re: How to enable a filter with regular expression with DXL
Edward_Wang - Thu Jun 09 04:18:32 EDT 2011

Sorry for a wrong description.

I want to view the objects that the object heading attribute contains 'test' +[a-zA-Z](+[a-zA-Z] is a regular expression)

Edward

Re: How to enable a filter with regular expression with DXL
SystemAdmin - Thu Jun 09 04:46:04 EDT 2011

Edward_Wang - Thu Jun 09 04:18:32 EDT 2011
Sorry for a wrong description.

I want to view the objects that the object heading attribute contains 'test' +[a-zA-Z](+[a-zA-Z] is a regular expression)

Edward

The reqular expression is a string which you use in the contains filtering as any other string
 

Module m = current 
string txt = "test+[a-zA-Z]" 
Filter f = contains(attribute "Object Heading", txt, false, true) 
set f 
filtering on

Re: How to enable a filter with regular expression with DXL
Edward_Wang - Thu Jun 09 05:01:30 EDT 2011

SystemAdmin - Thu Jun 09 04:46:04 EDT 2011

The reqular expression is a string which you use in the contains filtering as any other string
 

Module m = current 
string txt = "test+[a-zA-Z]" 
Filter f = contains(attribute "Object Heading", txt, false, true) 
set f 
filtering on

Thanks very much for the quick reply and sample code.

Edward