Talk:String Handling Routines

From Kolmafia
Revision as of 15:57, 19 August 2007 by 74.53.97.34 (talk)
Jump to navigation Jump to search

visual studio net 2003 professional konica minolta pagepro 1250w gstring sexy www nawaiwaqt com pk king outdoor store materassino www zucchero tour roma 2004 demolizioni varese classe aa condizionatori fissi retino piscine crociera lavoro virgin airline pianta di firenze video gratis di selen e rocco siffredi elmi ati radeon 32mb hotel a tenerife las dalias pc pentium 4 3 2 globus ionoforesi memorie ram ddr 266 pc2100 free italia sex testo verdena luna color service srl torino chat gartuito conversaciones livin on the edge agriturismo senigallia felpa sport donna abbigliamento sportivo the mummy il gamecube si puo modificare mf3110 toner michel everytime di britney spaers saldatrici second me foto di ragazze obese gel unghie bmw 725 tds 1999 dfi lanparty ut nf4 ultra-d mensole per camerette video sesso con animali rosa passos tutti giu per terra giuseppe culicchia faith hill. when the lights go down sixy pinay com flettner, anton c era un ragazzo gianni morandi pacew sancamaleon samsung 710 tv 17 mutu hard frasi d auguri di compleanno virtual dj 1 08 tastiera mouse ottico wireless vancouver (isola) vacanza in villaggio pioneer dcs 535 lavina media center cdc guaine a spruzzo overdrive katy rose batteria wireless vari accessori king arthur film dvd tihert metal slug 00 seggiolino da auto supernatural new carmina burana cam porn la storia nel medioevo fever michel buble mpio fl quiereme besame raf 2004 uomini sulla luna cartuccia ink jet compatibile stokke sleepi queen, ellery fax 2920 flaccianello fontodi www breakdance com my il tiranno del tibet caricatore cd autoradio mp3 ela weber nuda www ubisoft it videoclip smackdown vido t rio www tod s group com que es renacimiento tengo negrita tablature basso io con te non ci sto piu televisori samsung 29 new balance running shoe miss italia sexy meri tamigi rosa vinicio capossela un dvd in fuga starsky and hucth debussy infinito clone per giuochi pasion de sabado hotmail com pe mercedes lombardia garmin 2006 dance on the moon duratex toshiba rd xs32 fernada lima diffusori b il kevlar nokia 7110 navigatori mare lavoro su manduria serea sms mms strani giorni sony playstation2 www d www goteborg com ontario, lago- il lancio dei pinguini catania erboristerie carica alto candy lavatrici e lavasciuga barche vendita consulto cartomanzia amore mp3 software download foto diddlina casse senza fili p4 640 server dedicato linux vhf radioamatori paschi stradario di milano testi striscia regina da paura campioni di guai emilio de cavalieri falso movimento toner samsung scx4100 pci express sli honey and the moon joseph artur no le temasa el toshiba registratore cappe per cucina emme esse spa spermula www godo dollar gap f f f folling canon 5200n idkey non dirle chi sono sfondi gatto silvestro e titty nuntereggaepiu lampada 100w philips magic 2 come si chiama la rana piu grande del mo palmare ipaq h6340 campo di maggio carta parati pordenone enrico di milano vendita telefonini un mandarino per teo monica bellucci calendario universita di foggia dan balan fulda villaggio sicilia candy cth 107 infermiere nude the vampire slyer messa solenne lottomatica pasta di mais sur obscura cantalupo in sabina con publiweb english ps2 multi tap grignani mi stracci il cuore there you ll be faith hill moto storiche vendita renzo lucia promessi sposi tv usb 2 0 adattatore koversada www rosso alice com strength x quelque chose dans mon coeur elsa cat a pulta fergie sexy chalga sidis private line fisioterapia della spalla nike speedsweep gps esterno gioco gratis scaricare computer usb pen 256 sandisk photo di caparezza cavalli just accessori So wtf does group_string actually do? The linked "descriptive" post has an utterly unhelpful example. Has anyone ever used it for anything?

Groups a string into a map using a regular expression. To understand the function you must know. 1. What maps are and how they are used. 2. Understand what regular expressions are and how to create them.

Using the original post:

FUNCTION DEFINTION: string [int,int] group_string( string source, string regex ) EXAMPLE: string [int,int] test = group_string( "This is a test", "([a-z] ) " );

Example Breakdown: string [int,int] Define a map. Two dimensional. The indices are integers. The data is stored as a string. test Define the map with name test. group_string Call the function. "This is a Test" Feeding the function a sample string. "([a-z] ) " Your regular expression.

Regular expressions deal with pattern matching. You want the function to find a particular pattern. The function then returns that pattern, or the stuff before it, or the stuff after it, or splits them appart, or squeezes them together. So what does this regular expression look for? The Parenthesis (): Tell the function this is a group of characters. [a-z]: Tell us they will be lower case letters.  : Tell us to look for one or more characters. That space between the ) and " Tells us the pattern ends in a space.

Thus reading down the string. T = Does not match [a-z] is a capital letter. h = Matches [a-z]. Starting Group i = Matches [a-z] s = Matches [a-z]

 = Matches space. First group found and is "his "

i = Matches [a-z]. Starting Group s = Matches [a-z]

 = Matches space. Second group found, and is "is "

a = Matches [a-z]. Starting Group

 = Matches space. Third group found, and is "a "

t = Matches [a-z]. Starting Group e = Matches [a-z] s = Matches [a-z] t = Matches [a-z] End of line. No more matches. Stop.

Thus, trusting the post, the map would be:

test[0][0] => "his " test[0][1] => "his" test[1][0] => "is " test[1][1] => "is" test[2][0] => "a " test[2][1] => "a"

I personally haven't used it. Would be used in parsing a page by hand.