| |
|
|
Michael Wodrich | Search with regulären Audrücken.
@Match$( s1, s2 )
P:s1 - Suchmuster (Regulärer expression) P:s2 - Text, in the to the Suchmuster sought becomes
Result: String - The first found expression, the the pattern corresponds to, or one Leerstring, if the pattern not Text vorkommt.
in the simplest entrapment is the Suchmuster exakt the Text the sought becomes: @Match$("test", "Hausaufgabentest") would as Result "test" detect. here's though To mind, that some characters, The in Regulären squeeze out a particular weight having, not directly vorkommen can, The so-called "Metazeichen": .[]{}()|?+*^$~.
circa these characters in the pattern To use, is the Escapezeichen "~" vorzustellen. If I means z.B. whom expression "5^5" in the Text Search would like, should I Match$("5~^5", Text$) write. The weight the most important Metazeichen:
^, $ - the Potenzzeichen at the beginning the Musters sorgt for, that only one Vorkommen the Musters at the beginning the Textes found becomes, at Dollarzeichen must it on the Endes the Textes stand.
. (point) - The point standing for each arbitrary characters. the pattern "Ha.s" finds means z.B. "Haus", "Hans" or "Hals".
[abc] - Einzeichenmuster: The group in eckigen clinging standing for a characters from this group. the pattern "M[ae][iy]er" finds means The gentlemen Maier, Meier, Mayer and Meyer. The mr Maler remaining but outside to. the Minuszeichen can also akin go, circa a Zeichenbereich To describe: [a-d] finds The lower case "a", "b", "c" or "d". becomes too the "-" sought, ought to it first thing or letztes characters stand or with the "~" maskiert go: [-ad], [ad-] or [a~-d] finds The characters "a", "d" or "-". [A-Za-z0-9] finds any big- and lower case and any Digits.
(abc|def) - Alternativen: with the "|" go several Alternativen in the Suchmuster described. the pattern "M(ai|ey|au)er" finds only The gentlemen Maier, Meyer and wall.
?, +, *, {of, To} - replays: The previous expression or. the previous characters must in a designed amount vorkomen. in the individual: ? - the expression must 0 or 1 time vorkommen: "10?" finds "1"And "10", there the characters "0" one- or keinmal vorkommen must.
+ - the expression must at least 1 time vorkommen: "10+" finds means z.B. "10", "100" etc, but not "1" * - the expression can as often as you like vorkommen: "10*" finds "1", "10", "100", etc. {n} - the expression must exakt n time vorkommen: "10{2}" finds "100", "(ha){3}" finds "hahaha" and [0-9]{3} each dreistellige number. {n,} - the expression must at least n time vorkommen {n,m} - the expression must at least n time and not more than m time vorkommen too LINK:[InStr] and LINK:[Translate]$ can with regulären squeeze out works, if before Set("RegEx",1) staid watts.
|
|
|
| Programmieren, das spannendste Detektivspiel der Welt. | 08/13/07 ▲ |
|
|
|