Xbasic

UI_REGEX_BUILDER Function

Syntax

Regular_Expression as C = ui_regex_builder([C expression [,C regex_type [,C regex_syntax [,L ignore_case [,C test_text [,C replacement_string ]]]]]])

Arguments

Regular_Expression

Optional. Default = "". A properly formatted regular expression for subsequent use.

expression

Optional. Default = "". The search or matching text.

regex_type

Optional. Default = "Match". The options are:

"Match"
"Replace"
"Split"
regex_syntax

Optional. Default = "sed". The options are:

"Emacs"
"awk"
"grep"
"egrep"
"sed"
"extended"
ignore_case

Optional. Default = .F. . The options are: .T. = Case sensitive .F. = Case insensitive

test_text

Optional. Default = "". Text to test against the expression that you compose.

replacement_string

Optional. Default = "". The replacement text for replace and split operations.

Description

The UI_REGEX_BUILDER() function displays the Regular Expression Tester, which helps you build and test regular expressions.

Using the Regular Expression Tester 

1.

Select a Syntax style.

2.

Enter the data that you want to search for in the Regular Expression field.

3.

Optionally, select elements from the drop down list and click Insert.

4.

Select Yes or No in the Case sensitive field.

5.

For Expression type, select one of the following:

Match (Search)
Replace (Search and Replace)
Split (Extract list)
6.

If you selected Replace in step 4, make a selection from:

All matches or First match
Include match or Exclude match
7.

If you selected Replace or Split in step 4, enter a value in the Replacement String field.

8.

Optionally, enter a representative text sample in the Test string field. The result of the regular expression will appear in the Result field.

9.

Click close window button to generate the regular expression.

Limitations

Desktop applications only.

See Also