20.11.2002, 09:11 | #1 |
Участник
|
Поиск специальных символов
Добрый день!
Это уже было, знаю, но не могу найти... Есть какой-то хитрый способ мскать по Х++ тексту спец. знаки. Напр, я хочу найти фрагмент <20 Подскажите, плиз, как это сделать? Спасибо, Андрей |
|
20.11.2002, 09:39 | #2 |
----------------
|
Поиск
Поиск заданного текста в коде происходит с помощью функции match
А вот, что пишут в хелпе по этой функции Match Syntax int Match (str pattern,str text) Description Compares the fixed expression specified by pattern with the text string specified by text. Return value The function returns '1' if the pattern is located in the text string. Otherwise, the function returns '0' (zero). Examples Match("sen","Andersen") returns the value '1'. Match("sen","Schmidt") returns the value '0'. Match("<A?sen","Andersen") returns the value '1'. Notes The system does not differentiate between lower and upper case. A combination of fixed expressions is in itself a fixed expression. The following special characters can be used to create the pattern in the fixed expression: \ A backslash causes a specific character to be matched. For example, "\$" matches a dollar sign. < or ^ A 'less than' (<) sign or a circumflex (^) at the start of an expression is used to match the start of a line. > or & A 'greater than' (>) sign or an ampersand (&) at the end of the expression is used to match the end of a line. ? or . A question mark (?) or a full stop (.) will match any character (except Enter, new line). :x A colon specifies a group of characters to be matched, indicated by the character which follows immediately after. ':a' sets the match to letters ':d' sets the match to numeric characters ':n' sets the match to alphanumeric characters ': ' sets the match to blanks, tabulations and control characters such as Enter (new line). * An expression followed by an asterisk requires a match for none or several occurrences of the expression. For example, "fo*" will locate "f", "fo", "foo" etc. + An expression followed by a plus (+) sign requires a match for one or several occurrences of the expression. For example, "fo+" matches "fo" etc. - An expression followed by a minus (-) sign requires a match for no or one occurrence of the expression. For example, "fo-" matches "f" and "fo". [] A string of characters enclosed within square brackets specifies that a match is required for every character in this text, and only for these characters. For example, "[xyz]" matches "xx" and "zyx" etc. A string of characters can be specified by two characters separated by '-' (minus). For example, "[a-z]" matches all letters, whereas "[z-a]" never matches. [^] If the first character in a text within square brackets is a circumflex (^) then the expression matches all characters except Enter (new line) and the characters in the string. For example, "[^xyz]" matches "abc" but not "axb". |
|
20.11.2002, 11:17 | #3 |
Участник
|
Большое спасибо за ответ!
__________________
С уважением, Андрей Беседин |
|
|
Похожие темы | ||||
Тема | Ответов | |||
Как создать поле длиной более 255 символов? | 13 | |||
Поиск в Grid по полю DataMethod | 20 | |||
"поиск" | 6 | |||
Поиск по подстроке | 8 | |||
Поиск по полю временной таблицы | 2 |
Опции темы | Поиск в этой теме |
Опции просмотра | |
|