Attributes | Values |
---|
rdfs:label
| - Regular Expressions
- Regular expressions
|
rdfs:comment
| - Education | Version Control | Introduction to Programming | Unit Testing
- Intro text about regular expressions goes here How to learn goes here Examples go here function extractFrom(data, prefix, suffix) { var item = data.match(esc(prefix) + '([.\s\S]*?)' + esc(suffix)); if (item != null) return item[1]; return ""; } function esc(s) { var alfa = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var t = ""; for (i = 0; i < s.length; i++) { if (alfa.indexOf(s[i]) >= 0) { t += s[i];} else if ((" " <= s[i]) && (s[i] < String.fromCharCode(127))) { t += "\" + s[i]; } else t += s[i]; } return t; }
- The Delphi IDE Editor has a checkbox for Regular Expressions in the Find, Replace, and Find in Files menus. They are documented in the Delphi 5, 6 and 7 help. There are two flavors: Regular Expressions and Brief Regular Expressions (if you have Brief keystroke mappings).
- Regular expressions are a powerful pattern-matching tool. They allow patterns to be specified concisely and flexibly. For example, a regular expression to match a Zip code might look like \d{5}(\-\d{4})? -- 5 digits, optionally followed by a dash and 4 more digits. Craig Boyd has written an FLL called RegExp that allows VFP to use regexps without calling out to a COM library, as the FFC class does. Using it, we see that: lcZipRegex = "\d{5}(\-\d{4})?" ?regexp("02908", lcZipRegex) && .T. ?regexp("02908-2148", lcZipRegex) && .T. ?regexp("029082175", lcZipRegex) && .F.
|
dcterms:subject
| |
dbkwik:foxpro/prop...iPageUsesTemplate
| |
dbkwik:konfabulato...iPageUsesTemplate
| |
abstract
| - Education | Version Control | Introduction to Programming | Unit Testing
- Intro text about regular expressions goes here How to learn goes here Examples go here function extractFrom(data, prefix, suffix) { var item = data.match(esc(prefix) + '([.\s\S]*?)' + esc(suffix)); if (item != null) return item[1]; return ""; } function esc(s) { var alfa = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var t = ""; for (i = 0; i < s.length; i++) { if (alfa.indexOf(s[i]) >= 0) { t += s[i];} else if ((" " <= s[i]) && (s[i] < String.fromCharCode(127))) { t += "\" + s[i]; } else t += s[i]; } return t; }
- The Delphi IDE Editor has a checkbox for Regular Expressions in the Find, Replace, and Find in Files menus. They are documented in the Delphi 5, 6 and 7 help. There are two flavors: Regular Expressions and Brief Regular Expressions (if you have Brief keystroke mappings).
- Regular expressions are a powerful pattern-matching tool. They allow patterns to be specified concisely and flexibly. For example, a regular expression to match a Zip code might look like \d{5}(\-\d{4})? -- 5 digits, optionally followed by a dash and 4 more digits. Craig Boyd has written an FLL called RegExp that allows VFP to use regexps without calling out to a COM library, as the FFC class does. Using it, we see that: lcZipRegex = "\d{5}(\-\d{4})?" ?regexp("02908", lcZipRegex) && .T. ?regexp("02908-2148", lcZipRegex) && .T. ?regexp("029082175", lcZipRegex) && .F. An equivalent comparison in Xbase code would be quite a bit wordier.
|