Talk:String Handling Routines: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
Nas Spam
No edit summary
Line 1: Line 1:
So wtf does group_string actually do?  The linked "descriptive" post has an utterly unhelpful example.  Has anyone ever used it for anything?
[http://xenajedia.freehostia.com/when-you.htm when you re smiling] [http://gitannaa.freehostia.com/styles/fullout/ fullout] [http://stairslinaky.freehostia.com/data/ignis-icfs/ ignis icfs23] [http://chrome-naewfie.freehostia.com/data/sapore-di2.htm sapore di mare 2  un anno dopo] [http://ironic-aavocet.freehostia.com/musica-chilena/ musica chilena] [http://ironic-aavocet.freehostia.com/donne-nere/ donne nere nude] [http://11billioantries.freehostia.com/library/lavoro-campobasso.htm lavoro campobasso] [http://karotah.freehostia.com/katana-shirasaya.htm katana shirasaya] [http://malayoannaise86.freehostia.com/resources/lettori-divx/ lettori divx combo] [http://makesaomelove.freehostia.com/small/nota-spese/ nota spese] [http://agraciadoa.freehostia.com/data/epidurale.htm epidurale] [http://bluebloassoms.freehostia.com/nguyen-hong/ nguyen hong nhung sex] [http://dimterra.freehostia.com/lib/la-lunga/ la lunga notte di lucignolo 2004] [http://dobryganom.freehostia.com/data/giochi-francesi/ giochi francesi] [http://wellhaaveaball.freehostia.com/content/age-of6.htm age of imperius] [http://dimterra.freehostia.com/lib/toner-epson/ toner epson 5800] [http://malayoannaise86.freehostia.com/resources/se-fossi/ se fossi re] [http://ironic-aavocet.freehostia.com/intreccio-mortale/ intreccio mortale] [http://11billioantries.freehostia.com/library/yamaha-r.htm yamaha r1 moto] [http://malayoannaise86.freehostia.com/resources/translate/ translate] [http://dimterra.freehostia.com/lib/krugersdorp/ krugersdorp] [http://bluebloassoms.freehostia.com/plasma-2/ plasma 42 el] [http://11billioantries.freehostia.com/library/firewire-cardbus.htm firewire cardbus] [http://tatakarolia.freehostia.com/nomi-reali.htm nomi reali] [http://murasaaki-neko.freehostia.com/blog/tucarro-com.htm tucarro com] [http://chrome-naewfie.freehostia.com/data/xd-picture1.htm xd picture verbatim] [http://karotah.freehostia.com/xxx-arab.htm xxx arab girls vree and action] [http://malayoannaise86.freehostia.com/resources/linea-fantasma/ linea77 fantasma] [http://stairslinaky.freehostia.com/data/tunturi-tf/ tunturi t80f] [http://chrome-naewfie.freehostia.com/data/shake-it1.htm shake it mp3 download] [http://11billioantries.freehostia.com/library/mangime-gatto.htm mangime gatto] [http://dobryganom.freehostia.com/data/profumo-armani/ profumo armani mania] [http://chrome-naewfie.freehostia.com/data/hrmanita.htm hrmanita] [http://karotah.freehostia.com/nba-live2.htm nba live 2005] [http://makesaomelove.freehostia.com/small/fotos-de2/ fotos de chicas plei boy] [http://tatakarolia.freehostia.com/canon-mv.htm canon mv 850i videocamere] [http://chrome-naewfie.freehostia.com/data/deca.htm deca] [http://dobryganom.freehostia.com/data/sudi-noi/ sudi noi pupo] [http://gitannaa.freehostia.com/styles/bp-m/ bp 6m batteria nokia batterie per] [http://makesaomelove.freehostia.com/small/pinodaniele-pigro/ pinodaniele pigro] [http://bluebloassoms.freehostia.com/paul-mccartney/ paul mccartney music box biographical collection] [http://tatakarolia.freehostia.com/robot-moulinex.htm robot moulinex cucina] [http://sherberatmcgee.freehostia.com/new/titanic-dvd.htm titanic dvd] [http://stairslinaky.freehostia.com/data/webchat/ webchat] [http://ironic-aavocet.freehostia.com/usb-frontale/ usb frontale] [http://wellhaaveaball.freehostia.com/content/git-my.htm git my heart] [http://bluebloassoms.freehostia.com/nilza-monteiro/ nilza monteiro] [http://wellhaaveaball.freehostia.com/content/juanes-taboo.htm juanes taboo] [http://dimterra.freehostia.com/lib/impianto-hi/ impianto hi] [http://dobryganom.freehostia.com/data/riviste/ riviste] [http://wellhaaveaball.freehostia.com/content/don-bacchi.htm don bacchi] [http://chrome-naewfie.freehostia.com/data/dentro-di.htm dentro di te baroni] [http://chrome-naewfie.freehostia.com/data/latin-put.htm latin put] [http://dimterra.freehostia.com/lib/rammstein-and/ rammstein and amerika] [http://wellhaaveaball.freehostia.com/content/digital-doc.htm digital doc 5] [http://tatakarolia.freehostia.com/ebony-fuck.htm ebony fuck] [http://murasaaki-neko.freehostia.com/blog/incontrare-uomo.htm incontrare uomo] [http://dimterra.freehostia.com/lib/gayboys/ gayboys] [http://gitannaa.freehostia.com/styles/pensando-enti/ pensando enti] [http://dobryganom.freehostia.com/data/ww-gogle/ ww gogle com] [http://murasaaki-neko.freehostia.com/blog/cagnolini.htm cagnolini] [http://tatakarolia.freehostia.com/sonic-advance.htm sonic advance] [http://gitannaa.freehostia.com/styles/scale-alluminio/ scale alluminio] [http://chrome-naewfie.freehostia.com/data/karaoke-buble.htm karaoke buble] [http://wellhaaveaball.freehostia.com/content/la-famiglia1.htm la famiglia per freud] [http://ironic-aavocet.freehostia.com/voli-thailandia/ voli thailandia] [http://wellhaaveaball.freehostia.com/content/card-reader.htm card reader 6 1] [http://sherberatmcgee.freehostia.com/new/yamaha-pianocraft.htm yamaha pianocraft] [http://chrome-naewfie.freehostia.com/data/dark-and.htm dark and night] [http://stairslinaky.freehostia.com/data/nikkor-af/ nikkor af 28200 3 55 6 d] [http://murasaaki-neko.freehostia.com/blog/vegas-las.htm vegas las] [http://11billioantries.freehostia.com/library/scheda-video10.htm scheda video e cattura] [http://ironic-aavocet.freehostia.com/el1/ el 8] [http://sherberatmcgee.freehostia.com/new/vietnam-hotel.htm vietnam hotel] [http://ruefrosta.freehostia.com/directory/cassago-brianza.htm cassago brianza] [http://ruefrosta.freehostia.com/directory/genova-.htm genova 21 anni] [http://xenajedia.freehostia.com/vera-pelle.htm vera pelle] [http://makesaomelove.freehostia.com/small/odore-di/ odore di sborra] [http://sherberatmcgee.freehostia.com/new/borsa-morbida.htm borsa morbida canon] [http://11billioantries.freehostia.com/library/pagate.htm pagate] [http://gitannaa.freehostia.com/styles/jvc-dr1/ jvc dr mh20] [http://chrome-naewfie.freehostia.com/data/ch-checkit.htm ch checkit out] [http://stairslinaky.freehostia.com/data/computer-doppio/ computer doppio processore] [http://dimterra.freehostia.com/lib/toelettatura-animali/ toelettatura animali brascia] [http://stairslinaky.freehostia.com/data/irdeto-keys/ irdeto keys] [http://makesaomelove.freehostia.com/small/seagate-hd/ seagate hd] [http://solacahristus.freehostia.com/styles/hard-disk14/ hard disk cassetto] [http://murasaaki-neko.freehostia.com/blog/tarzan-boy.htm tarzan boy baltimore] [http://bluebloassoms.freehostia.com/drancy/ drancy] [http://ironic-aavocet.freehostia.com/sistema-home1/ sistema home teatre] [http://karotah.freehostia.com/der-herr.htm der herr ist mit mir] [http://ironic-aavocet.freehostia.com/bond/ bond] [http://agraciadoa.freehostia.com/data/lettori-portatili1.htm lettori portatili] [http://murasaaki-neko.freehostia.com/blog/microonde-whirlpool1.htm microonde whirlpool cottura a vapore] [http://stairslinaky.freehostia.com/data/interflora-chieti/ interflora chieti] [http://murasaaki-neko.freehostia.com/blog/hp-15.htm hp 1215 multifunzione] [http://gitannaa.freehostia.com/styles/biglietti-frasi/ biglietti frasi invito battesimo] [http://xenajedia.freehostia.com/gigabyte-ska.htm gigabyte ska] [http://tatakarolia.freehostia.com/ivete-sangalo1.htm ivete sangalo] [http://makesaomelove.freehostia.com/small/lybra-diesel/ lybra diesel] [http://sherberatmcgee.freehostia.com/new/dravite.htm dravite] [http://karotah.freehostia.com/demenziali.htm demenziali] [http://agraciadoa.freehostia.com/data/netgear-wgpsfs.htm netgear wgps606fs] [http://dimterra.freehostia.com/lib/troni/ troni] [http://xenajedia.freehostia.com/e-olympus.htm e1 olympus] [http://sherberatmcgee.freehostia.com/new/venera.htm venera] [http://gitannaa.freehostia.com/styles/segur-de/ segur de cala] [http://karotah.freehostia.com/elkann.htm elkann] [http://agraciadoa.freehostia.com/data/wallstreet.htm wallstreet] [http://makesaomelove.freehostia.com/small/qualification/ qualification] [http://11billioantries.freehostia.com/library/mt.htm mt 1075] [http://agraciadoa.freehostia.com/data/offerta-pc1.htm offerta pc antivirus] [http://tatakarolia.freehostia.com/sitios.htm sitios] [http://sherberatmcgee.freehostia.com/new/akai-campobasso.htm akai campobasso] [http://gitannaa.freehostia.com/styles/jak-zaponiec/ jak zaponiec] [http://stairslinaky.freehostia.com/data/jennifer-aniston/ jennifer aniston topless] [http://dobryganom.freehostia.com/data/stampanti-canon1/ stampanti canon ip 4000] [http://murasaaki-neko.freehostia.com/blog/biturbo-spider.htm biturbo spider] [http://murasaaki-neko.freehostia.com/blog/lavastoviglie-bosch.htm lavastoviglie bosch sgs] [http://dobryganom.freehostia.com/data/granita-di/ granita di anguria] [http://makesaomelove.freehostia.com/small/comune-di2/ comune di asti] [http://dimterra.freehostia.com/lib/tinka/ tinka] [http://tatakarolia.freehostia.com/nere-xxxx.htm nere xxxx] [http://sherberatmcgee.freehostia.com/new/storage-disk.htm storage disk] [http://solacahristus.freehostia.com/styles/golf-iv/ golf iv gti 150 tdi] [http://stairslinaky.freehostia.com/data/imoveis/ imoveis] [http://makesaomelove.freehostia.com/small/me-encontraras/ me encontraras] [http://solacahristus.freehostia.com/styles/dvix/ dvix] [http://solacahristus.freehostia.com/styles/braun-xp/ braun xp 5775] [http://bluebloassoms.freehostia.com/occasione-chevrolet/ occasione chevrolet corvette] [http://bluebloassoms.freehostia.com/djlover/ djlover] [http://wellhaaveaball.freehostia.com/content/microsoft-desktop.htm microsoft desktop cordless] [http://ironic-aavocet.freehostia.com/spartito-flauto/ spartito flauto] [http://ruefrosta.freehostia.com/directory/colonna-sonora5.htm colonna sonora ace ventura] [http://makesaomelove.freehostia.com/small/batteria-t/ batteria t68] [http://ruefrosta.freehostia.com/directory/partiture-notturni.htm partiture notturni] [http://makesaomelove.freehostia.com/small/moonlight-lady/ moonlight lady] [http://ironic-aavocet.freehostia.com/palace-hotel/ palace hotel roma] [http://ruefrosta.freehostia.com/directory/bici-ciclismo.htm bici ciclismo] [http://gitannaa.freehostia.com/styles/graduatoria-vfp/ graduatoria vfp1 esercito anno 2005] [http://solacahristus.freehostia.com/styles/que-tontos/ que tontos que locos] [http://dobryganom.freehostia.com/data/paula-jones/ paula jones] [http://agraciadoa.freehostia.com/data/vagabondo-che.htm vagabondo che son io] [http://tatakarolia.freehostia.com/media-stage.htm media stage for av 100] [http://dobryganom.freehostia.com/data/sintonizzatore-monitor/ sintonizzatore monitor] [http://murasaaki-neko.freehostia.com/blog/corso-di1.htm corso di cartomanzia] [http://murasaaki-neko.freehostia.com/blog/sigma7.htm sigma 18200] [http://stairslinaky.freehostia.com/data/brunello-montalcino/ brunello montalcino] [http://solacahristus.freehostia.com/styles/tabelle-danno/ tabelle danno biologico] [http://sherberatmcgee.freehostia.com/new/comune-di13.htm comune di massa martana] [http://makesaomelove.freehostia.com/small/powershot-1/ powershot 70 canon] [http://bluebloassoms.freehostia.com/vip-porno/ vip porno] [http://sherberatmcgee.freehostia.com/new/muccia.htm muccia] [http://gitannaa.freehostia.com/styles/digitale-sony/ digitale sony cybershot dsct5] [http://dobryganom.freehostia.com/data/cuffia-cobra/ cuffia cobra] [http://wellhaaveaball.freehostia.com/content/lettore-dvd23.htm lettore dvd portatile 10] [http://gitannaa.freehostia.com/styles/terza-rivoluzione/ terza rivoluzione industriale] [http://ruefrosta.freehostia.com/directory/facolta-di1.htm facolta di biologia alessandria] [http://murasaaki-neko.freehostia.com/blog/cisco-ip.htm cisco ip phone 7940] [http://stairslinaky.freehostia.com/data/i-don5/ i don t want to be] [http://tatakarolia.freehostia.com/abbondati.htm abbondati] [http://dimterra.freehostia.com/lib/pittura-parietale/ pittura parietale] [http://dimterra.freehostia.com/lib/inverter/ inverter 12] [http://murasaaki-neko.freehostia.com/blog/ghoul-panic.htm ghoul panic] [http://agraciadoa.freehostia.com/data/enermax-alimentatore.htm enermax alimentatore] [http://gitannaa.freehostia.com/styles/il-sorriso/ il sorriso del grande tentatore] [http://dimterra.freehostia.com/lib/serenissima-remix/ serenissima remix] [http://11billioantries.freehostia.com/library/oedipus-orca.htm oedipus orca] [http://wellhaaveaball.freehostia.com/content/forni-micronde.htm forni micronde] [http://murasaaki-neko.freehostia.com/blog/lampada-da2.htm lampada da tavolo] [http://chrome-naewfie.freehostia.com/data/ruta.htm ruta] [http://bluebloassoms.freehostia.com/rebelat/ rebelat] [http://xenajedia.freehostia.com/locali-lecce.htm locali lecce] [http://karotah.freehostia.com/counter.htm counter] [http://solacahristus.freehostia.com/styles/lara-snc/ lara snc] [http://dobryganom.freehostia.com/data/ingranaggi-plastica/ ingranaggi plastica] [http://wellhaaveaball.freehostia.com/content/maroon-this.htm maroon this love testo] [http://11billioantries.freehostia.com/library/gps-hamlet.htm gps hamlet bluetooth] [http://dobryganom.freehostia.com/data/elaborazione-scooter/ elaborazione scooter] [http://solacahristus.freehostia.com/styles/the-nreason/ the nreason] [http://tatakarolia.freehostia.com/dalla-z.htm dalla z allla a] [http://tatakarolia.freehostia.com/Biglietti-di1.htm biglietti di invito per i 18 anni] [http://solacahristus.freehostia.com/styles/daewoo-dv/ daewoo dv 700s] [http://agraciadoa.freehostia.com/data/un-poliziotto2.htm un poliziotto scomodo] [http://stairslinaky.freehostia.com/data/samsung-mp/ samsung mp3 yh820] [http://dimterra.freehostia.com/lib/violenza-per/ violenza per una giovane] [http://makesaomelove.freehostia.com/small/air-max1/ air max 2003] [http://karotah.freehostia.com/progres-veneto.htm progres veneto] [http://ruefrosta.freehostia.com/directory/televisori-con.htm televisori con dvd samsung] [http://gitannaa.freehostia.com/styles/tv-box1/ tv box terrestre] [http://murasaaki-neko.freehostia.com/blog/mosca-tze.htm mosca tze tze] [http://karotah.freehostia.com/high-power2.htm high power flash hfdc1] [http://karotah.freehostia.com/chiudi-chat.htm chiudi chat] [http://ironic-aavocet.freehostia.com/vhs-divx/ vhs divx dvd home theatre] [http://karotah.freehostia.com/jeans-cavalli.htm jeans cavalli roberto] [http://stairslinaky.freehostia.com/data/sexo-en/ sexo en la red] [http://stairslinaky.freehostia.com/data/morte-di/ morte di una stella] [http://dobryganom.freehostia.com/data/le-schiave/ le schiave di cartagine] [http://sherberatmcgee.freehostia.com/new/ford-cayman.htm ford cayman blue] [http://makesaomelove.freehostia.com/small/tema-su/ tema su manzoni] 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.
Groups a string into a map using a regular expression. To understand the function you must know.

Revision as of 00:37, 4 October 2007

when you re smiling fullout ignis icfs23 sapore di mare 2 un anno dopo musica chilena donne nere nude lavoro campobasso katana shirasaya lettori divx combo nota spese epidurale nguyen hong nhung sex la lunga notte di lucignolo 2004 giochi francesi age of imperius toner epson 5800 se fossi re intreccio mortale yamaha r1 moto translate krugersdorp plasma 42 el firewire cardbus nomi reali tucarro com xd picture verbatim xxx arab girls vree and action linea77 fantasma tunturi t80f shake it mp3 download mangime gatto profumo armani mania hrmanita nba live 2005 fotos de chicas plei boy canon mv 850i videocamere deca sudi noi pupo bp 6m batteria nokia batterie per pinodaniele pigro paul mccartney music box biographical collection robot moulinex cucina titanic dvd webchat usb frontale git my heart nilza monteiro juanes taboo impianto hi riviste don bacchi dentro di te baroni latin put rammstein and amerika digital doc 5 ebony fuck incontrare uomo gayboys pensando enti ww gogle com cagnolini sonic advance scale alluminio karaoke buble la famiglia per freud voli thailandia card reader 6 1 yamaha pianocraft dark and night nikkor af 28200 3 55 6 d vegas las scheda video e cattura el 8 vietnam hotel cassago brianza genova 21 anni vera pelle odore di sborra borsa morbida canon pagate jvc dr mh20 ch checkit out computer doppio processore toelettatura animali brascia irdeto keys seagate hd hard disk cassetto tarzan boy baltimore drancy sistema home teatre der herr ist mit mir bond lettori portatili microonde whirlpool cottura a vapore interflora chieti hp 1215 multifunzione biglietti frasi invito battesimo gigabyte ska ivete sangalo lybra diesel dravite demenziali netgear wgps606fs troni e1 olympus venera segur de cala elkann wallstreet qualification mt 1075 offerta pc antivirus sitios akai campobasso jak zaponiec jennifer aniston topless stampanti canon ip 4000 biturbo spider lavastoviglie bosch sgs granita di anguria comune di asti tinka nere xxxx storage disk golf iv gti 150 tdi imoveis me encontraras dvix braun xp 5775 occasione chevrolet corvette djlover microsoft desktop cordless spartito flauto colonna sonora ace ventura batteria t68 partiture notturni moonlight lady palace hotel roma bici ciclismo graduatoria vfp1 esercito anno 2005 que tontos que locos paula jones vagabondo che son io media stage for av 100 sintonizzatore monitor corso di cartomanzia sigma 18200 brunello montalcino tabelle danno biologico comune di massa martana powershot 70 canon vip porno muccia digitale sony cybershot dsct5 cuffia cobra lettore dvd portatile 10 terza rivoluzione industriale facolta di biologia alessandria cisco ip phone 7940 i don t want to be abbondati pittura parietale inverter 12 ghoul panic enermax alimentatore il sorriso del grande tentatore serenissima remix oedipus orca forni micronde lampada da tavolo ruta rebelat locali lecce counter lara snc ingranaggi plastica maroon this love testo gps hamlet bluetooth elaborazione scooter the nreason dalla z allla a biglietti di invito per i 18 anni daewoo dv 700s un poliziotto scomodo samsung mp3 yh820 violenza per una giovane air max 2003 progres veneto televisori con dvd samsung tv box terrestre mosca tze tze high power flash hfdc1 chiudi chat vhs divx dvd home theatre jeans cavalli roberto sexo en la red morte di una stella le schiave di cartagine ford cayman blue tema su manzoni 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.