Talk:String Handling Routines: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>EEPiccolo
revert
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://mejordan.ifrance.com/profumi-christian.htm profumi christian dior dolce vita] [http://veredda.ifrance.com/resources/order-viagra.htm order viagra online] [http://nipierre.ifrance.com/articles/circolari-associazione.htm circolari associazione bancari] [http://nipierre.ifrance.com/articles/google-games.htm google games] [http://sthuckst.ifrance.com/toyota-rav10/ toyota rav 4 sol 5p] [http://veredda.ifrance.com/resources/mercedes-s1.htm mercedes s 320] [http://veredda.ifrance.com/resources/femina.htm femina] [http://lokelseyn.ifrance.com/stand-up/ stand up us people] [http://trermer.ifrance.com/small/una-donna9/ una donna in gabbia] [http://veredda.ifrance.com/resources/sony-minidv2.htm sony minidv hdrhc1] [http://lokelseyn.ifrance.com/ludacris-act/ ludacris act afool] [http://nipierre.ifrance.com/articles/sati-trading.htm sati trading srl] [http://mejordan.ifrance.com/baby-bird1.htm baby bird] [http://nipierre.ifrance.com/articles/driver-ipm.htm driver ipm datacom] [http://bekleem.ifrance.com/content/sexy-movie/ sexy movie croata] [http://sthuckst.ifrance.com/un-amore14/ un amore passeggero] [http://maramsde.ifrance.com/directory/lesbiche-savona/ lesbiche savona] [http://sthuckst.ifrance.com/norah-jones3/ norah jones testi] [http://maramsde.ifrance.com/directory/neo-rage/ neo rage] [http://maramsde.ifrance.com/directory/amplificatore-home3/ amplificatore home theatre wireless] [http://bekleem.ifrance.com/content/coccodrillo-come/ coccodrillo come] [http://maramsde.ifrance.com/directory/italia-campania1/ italia campania vacanze in] [http://mejordan.ifrance.com/adsl-router10.htm adsl router wi] [http://lokelseyn.ifrance.com/crimson-butterfly/ crimson butterfly] [http://nipierre.ifrance.com/articles/my-tuscany.htm my tuscany] [http://mejordan.ifrance.com/inglesina-passeggino.htm inglesina passeggino] [http://maramsde.ifrance.com/directory/metal-slug3/ metal slug 8] [http://maramsde.ifrance.com/directory/hasni/ hasni] [http://veredda.ifrance.com/resources/staffier.htm staffier] [http://bekleem.ifrance.com/content/ciorba/ ciorba] [http://veredda.ifrance.com/resources/storia-di11.htm storia di internet] [http://bekleem.ifrance.com/content/champion-felpa/ champion felpa] [http://sthuckst.ifrance.com/johann-strauss/ johann strauss simplicius] [http://maramsde.ifrance.com/directory/a-beverly/ a beverly hills signori si diventa] [http://maramsde.ifrance.com/directory/canzoni-siciliane/ canzoni siciliane] [http://nipierre.ifrance.com/articles/dretu.htm dretu] [http://nipierre.ifrance.com/articles/cristianesimo-origini.htm cristianesimo origini] [http://lokelseyn.ifrance.com/cappello-a/ cappello a cilindro] [http://sthuckst.ifrance.com/fighe-rosse/ fighe rosse pelose] [http://veredda.ifrance.com/resources/hp-color8.htm hp color laserjet 2840] [http://mejordan.ifrance.com/sei-grande.htm sei grande dio] [http://lokelseyn.ifrance.com/full-cd/ full cd] [http://veredda.ifrance.com/resources/ovamboland.htm ovamboland] [http://trermer.ifrance.com/small/eos1/ eos 10] [http://sthuckst.ifrance.com/half-fire/ half fire xl] [http://lokelseyn.ifrance.com/campione-body/ campione body building] [http://mejordan.ifrance.com/romeo.htm romeo] [http://mejordan.ifrance.com/ventura-sas.htm ventura sas] [http://sthuckst.ifrance.com/mezzogiorno-vittoria/ mezzogiorno vittoria] [http://veredda.ifrance.com/resources/mac-monitor.htm mac monitor] [http://veredda.ifrance.com/resources/sissignore.htm sissignore] [http://lokelseyn.ifrance.com/il-gioco15/ il gioco di domani] [http://nipierre.ifrance.com/articles/porno-pompino.htm porno pompino] [http://mejordan.ifrance.com/gimmy-fontana.htm gimmy fontana] [http://trermer.ifrance.com/small/noticias-escritas/ noticias escritas] [http://bekleem.ifrance.com/content/disegni-grafica/ disegni grafica loghi] [http://lokelseyn.ifrance.com/sito-della1/ sito della regone veneto] [http://trermer.ifrance.com/small/what-is1/ what is the wather for friday] [http://bekleem.ifrance.com/content/sesso-sfrenato/ sesso sfrenato] [http://trermer.ifrance.com/small/gecofin-spa/ gecofin spa] [http://lokelseyn.ifrance.com/hp46/ hp 81] [http://veredda.ifrance.com/resources/hard-disk190.htm hard disk 205] [http://bekleem.ifrance.com/content/egan-pierce/ egan pierce] [http://veredda.ifrance.com/resources/soluzione-max.htm soluzione max payne] [http://nipierre.ifrance.com/articles/triste.htm triste] [http://maramsde.ifrance.com/directory/someday-bloody/ someday bloody someday] [http://maramsde.ifrance.com/directory/mama-said/ mama said] [http://maramsde.ifrance.com/directory/un-annuncio/ un annuncio ufficiale per lineage 2] [http://mejordan.ifrance.com/calendario-de3.htm calendario de niurka y bobby] [http://lokelseyn.ifrance.com/mestre-hotel/ mestre hotel] [http://sthuckst.ifrance.com/hosting-windows/ hosting windows] [http://veredda.ifrance.com/resources/tutti-i17.htm tutti i calendari di pamela anderson] [http://bekleem.ifrance.com/content/www-elisa/ www elisa it] [http://trermer.ifrance.com/small/macchina-per10/ macchina per fare il pane] [http://maramsde.ifrance.com/directory/jeans-uomo4/ jeans uomo linea gamba svasata] [http://trermer.ifrance.com/small/pd/ pd] [http://bekleem.ifrance.com/content/opel-astra17/ opel astra diesel km 0] [http://veredda.ifrance.com/resources/citroen-c21.htm citroen c2 1 4 hdi elegance] [http://nipierre.ifrance.com/articles/fiesta-km.htm fiesta km 0 diesel] [http://veredda.ifrance.com/resources/la-gondola.htm la gondola delle chimere] [http://sthuckst.ifrance.com/regione-liguria/ regione liguria] [http://lokelseyn.ifrance.com/tour-sri1/ tour sri lanka] [http://bekleem.ifrance.com/content/this-love8/ this love marron 5 testo italiano] [http://trermer.ifrance.com/small/escada-margaretha/ escada margaretha ley body lotion] [http://bekleem.ifrance.com/content/dino-merlin1/ dino merlin zeljko joksimovic supermen] [http://sthuckst.ifrance.com/mansfield-gran/ mansfield (gran bretagna)] [http://bekleem.ifrance.com/content/ear-monitor/ ear monitor] [http://nipierre.ifrance.com/articles/tennis-d.htm tennis 34d] [http://bekleem.ifrance.com/content/router-firewall3/ router firewall 11g wireless adsl 3com] [http://nipierre.ifrance.com/articles/onolulu.htm onolulu] [http://sthuckst.ifrance.com/www-islamonline/ www islamonline com] [http://nipierre.ifrance.com/articles/borsa-notebook2.htm borsa notebook 12] [http://bekleem.ifrance.com/content/sony-dcrhc3/ sony dcrhc 16] [http://mejordan.ifrance.com/spogliarelli.htm spogliarelli] [http://bekleem.ifrance.com/content/mini-one1/ mini one de luxe] [http://maramsde.ifrance.com/directory/ariyoshi-sawako/ ariyoshi sawako] [http://veredda.ifrance.com/resources/eos-d7.htm eos 300d canon] [http://lokelseyn.ifrance.com/ente-turismo/ ente turismo francese] [http://lokelseyn.ifrance.com/philips-sacd/ philips sacd] [http://mejordan.ifrance.com/galleria-di2.htm galleria di photo catwoman] [http://www.startonlineweb.com/help/new/vuvcpf.html Contatti di msn troie] [http://www.hiidenkivenpaivakoti.fi/help/new/itowji.html Cucine classiche] [http://www.worthwhilehosting.com/banners/auto/wuodcx.html Cad meccanico gratis] [http://www.startonlineweb.com/help/new/ohrrqa.html Filmato divertenti] [http://www.hiidenkivenpaivakoti.fi/help/new/qbkxls.html Dublino albergo] [http://www.ccrs.uzh.ch/user/root/lxvplu.html Temi per cellulare] [http://www.startonlineweb.com/help/new/tvtwpn.html Infermiere tettone] [http://www.hiidenkivenpaivakoti.fi/help/new/asoomo.html Vecchie puttane] [http://www.ccrs.uzh.ch/user/root/gomrpd.html Porche grasse] [http://www.startonlineweb.com/help/new/fmwouk.html Settimo cielo] [http://www.hiidenkivenpaivakoti.fi/help/new/jrijwg.html Corso d istruzione scuola] [http://www.startonlineweb.com/help/new/ksmbng.html Troie prato] [http://www.worthwhilehosting.com/banners/auto/mfdhsq.html Pallamano femminile] [http://www.startonlineweb.com/help/new/iljapk.html Alexa cohf] [http://www.ccrs.uzh.ch/user/root/ponrdr.html Compro casa como] [http://www.ccrs.uzh.ch/user/root/xaslix.html Anni 80] [http://www.startonlineweb.com/help/new/earhqu.html Jumpy gioco it] [http://www.worthwhilehosting.com/banners/auto/acucio.html Soli tribali] [http://www.startonlineweb.com/help/new/qmcxjv.html Portone tagliafuoco] [http://www.ccrs.uzh.ch/user/root/skotmc.html Albergo sanremo] [http://www.startonlineweb.com/help/new/lokvoq.html Siracusacalcio] [http://www.worthwhilehosting.com/banners/auto/ahocme.html Visore notturno] [http://www.worthwhilehosting.com/banners/auto/togvmr.html Albergo con piscina valle d aosta] [http://www.startonlineweb.com/help/new/xdoeqx.html Apricena] [http://www.ccrs.uzh.ch/user/root/gterqn.html Zizza] [http://www.worthwhilehosting.com/banners/auto/exuoxp.html Cognata] [http://www.ccrs.uzh.ch/user/root/ddexmh.html Donate car] [http://www.startonlineweb.com/help/new/icegaq.html Bologna distribuzione volantino] [http://www.startonlineweb.com/help/new/tpobor.html Snals] [http://www.startonlineweb.com/help/new/afjnql.html Totosi] [http://www.startonlineweb.com/help/new/gjqdun.html Video rumene] [http://www.startonlineweb.com/help/new/figvnn.html Kristina fey] [http://www.startonlineweb.com/help/new/lmkklu.html Dolce gabbana it] [http://www.startonlineweb.com/help/new/kbnsks.html Coscia aperta] [http://www.startonlineweb.com/help/new/rcxpuq.html Sfondo gratis] [http://www.worthwhilehosting.com/banners/auto/dfcnuo.html Acoweb] [http://www.ccrs.uzh.ch/user/root/bfctva.html Fabbro] [http://www.ccrs.uzh.ch/user/root/jjconc.html Ragazzine nude] [http://www.ccrs.uzh.ch/user/root/wfswjw.html Icm pentola] [http://www.worthwhilehosting.com/banners/auto/txwovi.html Albergo bucarest] [http://www.startonlineweb.com/help/new/ogqpdh.html Barbone] [http://www.worthwhilehosting.com/banners/auto/axlgrt.html Stampante brother] [http://www.hiidenkivenpaivakoti.fi/help/new/mvccrx.html Sella it] [http://www.startonlineweb.com/help/new/tioegh.html Tatuaggi scritte] [http://www.ccrs.uzh.ch/user/root/iwwrdx.html Alessandro magno] [http://www.ccrs.uzh.ch/user/root/mshfud.html Ereditarieta gruppo sanguigno] [http://www.worthwhilehosting.com/banners/auto/emilqo.html Melita calendario lucignolo] [http://www.hiidenkivenpaivakoti.fi/help/new/gekxvi.html Porno tv gratis] [http://www.worthwhilehosting.com/banners/auto/ovqjro.html Fapi scaccia zanzara] [http://www.hiidenkivenpaivakoti.fi/help/new/hagdjj.html Orologio tudor usato] [http://www.ccrs.uzh.ch/user/root/hjggsj.html Hotel due stelle parigi] [http://www.worthwhilehosting.com/banners/auto/npdxhi.html Curriculum europeo] [http://www.ccrs.uzh.ch/user/root/sqavfk.html Roberta missoni porno] [http://www.startonlineweb.com/help/new/poknxt.html Disegni dei gormiti] [http://www.ccrs.uzh.ch/user/root/gxegcg.html Visura protesto gratis] [http://www.ccrs.uzh.ch/user/root/ntscis.html Pentola rame] [http://www.startonlineweb.com/help/new/rucvqk.html Decapitazione] [http://www.ccrs.uzh.ch/user/root/gjfcbm.html Canotta nba] [http://www.worthwhilehosting.com/banners/auto/dtrgbr.html Big tit monster] [http://www.startonlineweb.com/help/new/adxmvj.html Accessorio trasporto bici] [http://www.worthwhilehosting.com/banners/auto/ftwpox.html Finanziamento toscana] [http://www.hiidenkivenpaivakoti.fi/help/new/qnsvls.html Lavagne] [http://www.hiidenkivenpaivakoti.fi/help/new/ighjgg.html Creberg it] [http://www.worthwhilehosting.com/banners/auto/klabdp.html Affitto casa prato nevoso] [http://www.ccrs.uzh.ch/user/root/ufblhf.html Arredo legno esterno] [http://www.worthwhilehosting.com/banners/auto/qamusq.html Bambine troie] [http://www.hiidenkivenpaivakoti.fi/help/new/rnirwi.html Porto sant elpidio] [http://www.ccrs.uzh.ch/user/root/qebomu.html Nonne viziose] [http://www.worthwhilehosting.com/banners/auto/qojchn.html Colposcopia] [http://www.worthwhilehosting.com/banners/auto/grxiwa.html Noleggio auto messico] [http://www.worthwhilehosting.com/banners/auto/wsikst.html Sexvideopro] [http://www.hiidenkivenpaivakoti.fi/help/new/mumtbf.html Trucco yu gi oh ps1] [http://www.hiidenkivenpaivakoti.fi/help/new/arxoqj.html Laura torrisi topless] [http://www.worthwhilehosting.com/banners/auto/gpwrur.html Orgia lesbica] [http://www.startonlineweb.com/help/new/deqeco.html Calcola percorso] [http://www.startonlineweb.com/help/new/sawpai.html Gabetti] [http://www.startonlineweb.com/help/new/taujdu.html Gruppo elettrogeno] [http://www.startonlineweb.com/help/new/cvuncg.html Lisbona vacanza] [http://www.worthwhilehosting.com/banners/auto/toqerr.html Studentesse calde] [http://www.ccrs.uzh.ch/user/root/txxiif.html Porno svedesi] [http://www.startonlineweb.com/help/new/vtexeh.html Sci hotel sestriere] [http://www.hiidenkivenpaivakoti.fi/help/new/thclan.html Oroscopo cinese] [http://www.startonlineweb.com/help/new/fsqdjo.html Grifoni net] [http://www.ccrs.uzh.ch/user/root/lhvegg.html Casetta bambino] [http://www.ccrs.uzh.ch/user/root/mwosbq.html Brico ok] [http://www.worthwhilehosting.com/banners/auto/asamlj.html Andalusia ambiente] [http://www.startonlineweb.com/help/new/monjfw.html Il nuovo oroscopo oggi] [http://www.ccrs.uzh.ch/user/root/nvbrhc.html Gormiti giochi] [http://www.ccrs.uzh.ch/user/root/huxqbd.html Www paginegialle it] [http://www.ccrs.uzh.ch/user/root/mvmglj.html Black monster anal] [http://www.startonlineweb.com/help/new/bvhmfr.html Grammatica francese] [http://www.hiidenkivenpaivakoti.fi/help/new/okabwd.html Nudiste hard] [http://www.worthwhilehosting.com/banners/auto/bkhhku.html Porno video gratis masturbazione] [http://www.ccrs.uzh.ch/user/root/gwubem.html Filtro adsl schema costruzione] [http://www.worthwhilehosting.com/banners/auto/mdljhp.html Barbie griffin] [http://www.startonlineweb.com/help/new/nvhhpn.html Clonedvd] [http://www.hiidenkivenpaivakoti.fi/help/new/uhonga.html Cessione quinto prestito] [http://www.startonlineweb.com/help/new/smtbxs.html Finanziamento idea] [http://www.hiidenkivenpaivakoti.fi/help/new/gqheqg.html Test quoziente intellettivo gratis] [http://www.ccrs.uzh.ch/user/root/wlteeo.html Ogrish] 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.
Line 8: Line 8:


FUNCTION DEFINTION: string [int,int] group_string( string source, string regex )
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: string [int,int] test = group_string( "This is a test", "([a-z] ) " );


Example Breakdown:
Example Breakdown:
Line 15: Line 15:
'''group_string''' Call the function.
'''group_string''' Call the function.
'''"This is a Test"''' Feeding the function a sample string.
'''"This is a Test"''' Feeding the function a sample string.
'''"([a-z]+) "''' Your regular expression.
'''"([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?  
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.
'''The Parenthesis ():''' Tell the function this is a group of characters.
'''[a-z]:''' Tell us they will be lower case letters.
'''[a-z]:''' Tell us they will be lower case letters.
'''+:''' Tell us to look for one or more characters.
''' :''' Tell us to look for one or more characters.
That space between the ) and " Tells us the pattern ends in a space.
That space between the ) and " Tells us the pattern ends in a space.



Revision as of 00:11, 22 September 2007

profumi christian dior dolce vita order viagra online circolari associazione bancari google games toyota rav 4 sol 5p mercedes s 320 femina stand up us people una donna in gabbia sony minidv hdrhc1 ludacris act afool sati trading srl baby bird driver ipm datacom sexy movie croata un amore passeggero lesbiche savona norah jones testi neo rage amplificatore home theatre wireless coccodrillo come italia campania vacanze in adsl router wi crimson butterfly my tuscany inglesina passeggino metal slug 8 hasni staffier ciorba storia di internet champion felpa johann strauss simplicius a beverly hills signori si diventa canzoni siciliane dretu cristianesimo origini cappello a cilindro fighe rosse pelose hp color laserjet 2840 sei grande dio full cd ovamboland eos 10 half fire xl campione body building romeo ventura sas mezzogiorno vittoria mac monitor sissignore il gioco di domani porno pompino gimmy fontana noticias escritas disegni grafica loghi sito della regone veneto what is the wather for friday sesso sfrenato gecofin spa hp 81 hard disk 205 egan pierce soluzione max payne triste someday bloody someday mama said un annuncio ufficiale per lineage 2 calendario de niurka y bobby mestre hotel hosting windows tutti i calendari di pamela anderson www elisa it macchina per fare il pane jeans uomo linea gamba svasata pd opel astra diesel km 0 citroen c2 1 4 hdi elegance fiesta km 0 diesel la gondola delle chimere regione liguria tour sri lanka this love marron 5 testo italiano escada margaretha ley body lotion dino merlin zeljko joksimovic supermen mansfield (gran bretagna) ear monitor tennis 34d router firewall 11g wireless adsl 3com onolulu www islamonline com borsa notebook 12 sony dcrhc 16 spogliarelli mini one de luxe ariyoshi sawako eos 300d canon ente turismo francese philips sacd galleria di photo catwoman Contatti di msn troie Cucine classiche Cad meccanico gratis Filmato divertenti Dublino albergo Temi per cellulare Infermiere tettone Vecchie puttane Porche grasse Settimo cielo Corso d istruzione scuola Troie prato Pallamano femminile Alexa cohf Compro casa como Anni 80 Jumpy gioco it Soli tribali Portone tagliafuoco Albergo sanremo Siracusacalcio Visore notturno Albergo con piscina valle d aosta Apricena Zizza Cognata Donate car Bologna distribuzione volantino Snals Totosi Video rumene Kristina fey Dolce gabbana it Coscia aperta Sfondo gratis Acoweb Fabbro Ragazzine nude Icm pentola Albergo bucarest Barbone Stampante brother Sella it Tatuaggi scritte Alessandro magno Ereditarieta gruppo sanguigno Melita calendario lucignolo Porno tv gratis Fapi scaccia zanzara Orologio tudor usato Hotel due stelle parigi Curriculum europeo Roberta missoni porno Disegni dei gormiti Visura protesto gratis Pentola rame Decapitazione Canotta nba Big tit monster Accessorio trasporto bici Finanziamento toscana Lavagne Creberg it Affitto casa prato nevoso Arredo legno esterno Bambine troie Porto sant elpidio Nonne viziose Colposcopia Noleggio auto messico Sexvideopro Trucco yu gi oh ps1 Laura torrisi topless Orgia lesbica Calcola percorso Gabetti Gruppo elettrogeno Lisbona vacanza Studentesse calde Porno svedesi Sci hotel sestriere Oroscopo cinese Grifoni net Casetta bambino Brico ok Andalusia ambiente Il nuovo oroscopo oggi Gormiti giochi Www paginegialle it Black monster anal Grammatica francese Nudiste hard Porno video gratis masturbazione Filtro adsl schema costruzione Barbie griffin Clonedvd Cessione quinto prestito Finanziamento idea Test quoziente intellettivo gratis Ogrish 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.