Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.re.testing.umlauts
local (adrtable = @temp.regexUmlautTest);
new (tableType, adrtable);
local (adrposix = @adrtable^.posix);
new (tableType, adrposix);
local (charList = {});
for i = 0 to 255 {
charList = charList + char (i)};
adrtable^.charList = charList;
bundle { //generic char types
adrtable^.word = re.grep (re.compile ("\\w"), adrtable^.charList);
adrtable^.nonword = re.grep (re.compile ("\\W"), adrtable^.charList);
adrtable^.whitespace = re.grep (re.compile ("\\s"), adrtable^.charList);
adrtable^.nonwhitespace = re.grep (re.compile ("\\S"), adrtable^.charList);
adrtable^.digit = re.grep (re.compile ("\\d"), adrtable^.charList);
adrtable^.nondigit = re.grep (re.compile ("\\D"), adrtable^.charList)};
bundle { //posix character classes
on testPosixClass (name) {
adrposix^.["[:" + name + ":]"] = re.grep (re.compile ("[[:" + name + ":]]", flCaseSensitive:true), adrtable^.charList);
adrposix^.["^[:" + name + ":]"] = re.grep (re.compile ("[^[:" + name + ":]]", flCaseSensitive:true), adrtable^.charList)};
testPosixClass ("alnum");
testPosixClass ("alpha");
testPosixClass ("ascii");
testPosixClass ("blank");
testPosixClass ("cntrl");
testPosixClass ("digit");
testPosixClass ("graph");
testPosixClass ("lower");
testPosixClass ("print");
testPosixClass ("punct");
testPosixClass ("space");
testPosixClass ("upper");
testPosixClass ("word");
testPosixClass ("xdigit")};
edit (adrtable)
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.