-    UD6 Option Pack - XMLGREP    

Simple Searching using XMLGREP.

Using XMLGREP you can search using any regular expression, and you will be given a list of all the XML Files that the expression occurs in.

Enter a search expression in the Search: field, and a file/directory widlecard in the File / Dir: field and then press the XMLGREP button and your search will begin. For example:

Regular Expressions

XMLGREP uses regular expressions to search for text in your XML source code which gives you maximum flexibility and power for finding what you are looking for.

Regular expressions are defined in IEEE Std 1003.2 ("POSIX.2") and can be quite complex, a short overview is given in here and a more thorough technical explanation in the Regular Expressions section.

A regular expression search term in XMLGREP usually must match a single line, search patterns that match text over several lines is permitted by selecting the "Cross Lines" option. A regular expression search term may be made up of known and unknown parts, For example:

Search:Matches:
askmess
ask.ess
askmess.*"
askmess[[:blank:]]*"

Match any character "."

The period "." character has a special meaning in a regular expression. It matches any one character. In the examples above the period "." matches either m, M, T. If you want to find an actual period in your XML source code then you should use the regular expression "\.".

Match previous expression any number of times

The asterisk "*" character has a special meaning in a regular expression. It matches the previous expression any number of times. It is usually used in conjunction with either "." or another regular expression. Note: "askmess*" would find instances of "askmess" and "askmesssssss" etc.

If you want to find an actual asterisk in your XML source code then you should use the regular expression "\*". A gold * can be found using the regular expression "<gold>\*</gold>".

Match a range of characters "[]"

The bracket "[]" characters have a special meaning in a regular expression. It matches a range of characters. In the examples above the bracket expression "[[:blank:]]" matches a single white space character such as space or tab. In the example above the bracket expression is followed by the asterisk to match multiple while space characters.

If you want to find an actual bracket in your XML source code then you should use the regular expression "\[".

Characters that have special meaning in a regular expression

The following characters all have special meaning within a search expression: "^.[$()|*+?{\". If you want to find one of these characters in your XML source code then you should use the backslash character immediately before the character that has special meaning. For example to find the line continuation character pair in your XML source code use the expression "%\\".

Characters that have special meaning in XML

The ampersand "&" and less than "<" characters have special meaning in an XML file. If you want to find one of these characters in your Uniface source code then you should use "&amp;" (for ampersand) or "&lt;" (for less than). For example to find the proc condition if (custid<0) then you use the regular expression "if \(custid&lt;0)".

Read more about Searching and Replacing using XMLGREP

$Revision$ $Date$[go to top]