- |
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:
askmess
c:\usys72\project\sources\components.dir\A*.XML
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 | askmess "Are you sure" |
AskMess /query "Select a color to askTess","Red,Green,Blue" | |
putmess "Select an askmess ","Query,Error" | |
ask.ess | askmess "Are you sure" |
AskMess /query "Select a color to askTess ","Red,Green,Blue" | |
askmess.*" | askmess " Are you sure" |
AskMess/query " Select a color to askTess","Red,Green,Blue" | |
putmess "Select an askmess" ,"Query,Error" | |
askmess[[:blank:]]*" | askmess "Are you sure" |
AskMess /query "Select a color to askTess","Red,Green,Blue" | |
putmess "Select an askmess ","Query,Error" |
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 "\.
".
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>
".
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 "\[
".
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 "%\\
".
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 "&
" (for ampersand) or "<
" (for less than). For example to find the proc condition if (custid<0)
then you use the regular expression "if \(custid<0)
".
Read more about Searching and Replacing using XMLGREP
$Revision$ $Date$ | [go to top] |