Talk:String Handling Routines: Difference between revisions
imported>Alacrity mNo edit summary |
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://web.rigour.info/paglialunga/ paglialunga] [http://pagina.rigour.info/cartuccia-epson/ cartuccia epson c60] [http://gratis.rigour.info/content/view/notti-di.htm notti di cabiria] [http://pagina.rigour.info/km-rover/ km0 rover discovery auto km 0] [http://online.rigour.info/pelicula-titanic/ pelicula titanic] [http://note.rigour.info/content/view/orologio-fasi.htm orologio fasi lunari] [http://note.rigour.info/content/view/due-assi.htm due assi nella manica] [http://speed.rigour.info/laface-enzo.htm laface enzo] [http://italy.rigour.info/blog/indesit-wp.htm indesit wp 100] [http://blog.rigour.info/web/gigi-and/ gigi and molly] [http://online.rigour.info/heterohyrax/ heterohyrax] [http://content.rigour.info/html/volvo-varese/ volvo varese] [http://online.rigour.info/buzzle/ buzzle] [http://content.rigour.info/html/dipinto-paesaggio/ dipinto paesaggio] [http://load.rigour.info/view/new/natacha.htm natacha] [http://milano.rigour.info/galeria-gratis.htm galeria gratis chicos famosos] [http://pagina.rigour.info/neger-bums/ neger bums mich] [http://all.rigour.info/moto-mondiale/ moto mondiale] [http://blog.rigour.info/web/r-/ r 1200 gs] [http://italy.rigour.info/blog/clara-morgan.htm clara morgan] [http://uve.rigour.info/blog/nuda-di.htm nuda di max de angeli] [http://down.rigour.info/blog/oakley-crosshair.htm oakley crosshair] [http://uve.rigour.info/blog/work.htm work] [http://online.rigour.info/manowar-wheels/ manowar wheels of fire] [http://uve.rigour.info/blog/gande-fratello.htm gande fratello uk] [http://milano.rigour.info/mulinello-surf.htm mulinello surf] [http://uve.rigour.info/blog/il-croccodile.htm il croccodile come fa] [http://paga.rigour.info/la-colina/ la colina de la vida de ataque 77] [http://web.rigour.info/kenzo-eau/ kenzo eau] [http://online.rigour.info/coppie-over/ coppie over 50 grasse] [http://paga.rigour.info/polistirolo-prato/ polistirolo prato] [http://content.rigour.info/html/polo-jersey/ polo jersey uomo] [http://gratis.rigour.info/content/view/t-amo.htm t amo] [http://pagina.rigour.info/ps-gt/ ps2 gt 4] [http://dir.rigour.info/laser-hp/ laser hp stampante] [http://gratis.rigour.info/content/view/enterostomie.htm enterostomie] [http://here.rigour.info/blog/frigorifero-coca.htm frigorifero coca cola] [http://italy.rigour.info/blog/rossanna.htm rossanna] [http://italy.rigour.info/blog/mitsubishi-.htm mitsubishi - pajero] [http://italy.rigour.info/blog/golden-sun.htm golden sun] [http://milano.rigour.info/the-o.htm the o c telefilm] [http://web.rigour.info/palm-te/ palm te2] [http://all.rigour.info/tamron-mm/ tamron 28-75mm] [http://guest.rigour.info/library/html/gci-net/ gci net] [http://it.rigour.info/topic/finanziamento-berlin/ finanziamento berlin] [http://uve.rigour.info/blog/www-aduc.htm www aduc it] [http://dir.rigour.info/reyno-animal/ reyno animal] [http://milano.rigour.info/s.htm s3] [http://content.rigour.info/html/racconti-erotici/ racconti erotici moglie] [http://italy.rigour.info/blog/porte-chiuse.htm porte chiuse] [http://pagina.rigour.info/cooperative-edilizie/ cooperative edilizie torino] [http://milano.rigour.info/dying-diana.htm dying diana] [http://gratis.rigour.info/content/view/one-t.htm one t ft cool t the magic key] [http://gratis.rigour.info/content/view/epson-stylus.htm epson stylus photo rx] [http://web.rigour.info/sms-gain/ sms gain] [http://load.rigour.info/view/new/villa-santantonio.htm villa santantonio] [http://milano.rigour.info/san-remo.htm san remo 2002] [http://guest.rigour.info/library/html/profumi-gucci/ profumi gucci] [http://all.rigour.info/spia-spione/ spia spione] [http://down.rigour.info/blog/calzature-donna.htm calzature donna inverno 40 prada] [http://it.rigour.info/topic/mercatino-trieste/ mercatino trieste] [http://load.rigour.info/view/new/ministerointerni.htm ministerointerni] [http://load.rigour.info/view/new/the-battle.htm the battle di hans zimmer] [http://note.rigour.info/content/view/apple-mouse.htm apple mouse] [http://web.rigour.info/ingresso-videocamere/ ingresso videocamere] [http://blog.rigour.info/web/adsl-firewall/ adsl2 firewall router] [http://speed.rigour.info/giochi-di.htm giochi di avventura 3d] [http://load.rigour.info/view/new/distretto-militare.htm distretto militare di salerno] [http://online.rigour.info/racchetta-da/ racchetta da tennis dunlop] [http://italy.rigour.info/blog/jonni.htm jonni] [http://load.rigour.info/view/new/giochi-demo.htm giochi demo di strategia] [http://down.rigour.info/blog/arei.htm arei] [http://it.rigour.info/topic/prealpi-srl/ prealpi srl] [http://content.rigour.info/html/tammorriata/ tammorriata] [http://note.rigour.info/content/view/pugni-chiusi.htm pugni chiusi] [http://paga.rigour.info/fr-david/ fr david] [http://uve.rigour.info/blog/kinkyman.htm kinkyman] [http://up.rigour.info/description/lib/auto-noleggio.htm auto noleggio vigevano] [http://gratis.rigour.info/content/view/luci-e.htm luci e ombre per il tokyo game show autunnale] [http://web.rigour.info/cachorros/ cachorros] [http://pagina.rigour.info/foto-donne/ foto donne comuni nude] [http://uve.rigour.info/blog/stradale-belluno.htm stradale belluno] [http://pagina.rigour.info/volo-lissone/ volo lissone] [http://content.rigour.info/html/cheap/ cheap] [http://note.rigour.info/content/view/obiettivi-canon.htm obiettivi canon ef 55-200] [http://up.rigour.info/description/lib/dsc-t.htm dsc t7 sony] [http://load.rigour.info/view/new/photoshop.htm photoshop 8] [http://uve.rigour.info/blog/rav.htm rav4 2002] [http://paga.rigour.info/tesi-scienze/ tesi scienze statistiche] [http://uve.rigour.info/blog/reale-mutua.htm reale mutua assicurazione] [http://content.rigour.info/html/racconti-/ racconti sculacciate] [http://content.rigour.info/html/rh-mh/ rh 7900mh] [http://load.rigour.info/view/new/confessionale.htm confessionale] [http://load.rigour.info/view/new/calendario-costantino.htm calendario costantino] [http://it.rigour.info/topic/hydromania/ hydromania] [http://speed.rigour.info/newport-hotel.htm newport hotel] [http://speed.rigour.info/amplificatori-valvole.htm amplificatori valvole verona] [http://down.rigour.info/blog/trapano-black.htm trapano black decker] [http://pagina.rigour.info/cartuccia-oro/ cartuccia oro] [http://here.rigour.info/blog/air-.htm air 3 bud] [http://up.rigour.info/description/lib/asus-pda.htm asus pda phone] [http://load.rigour.info/view/new/sostanza-dimagranti.htm sostanza dimagranti] [http://uve.rigour.info/blog/fred-dal.htm fred dal whisky facile] [http://load.rigour.info/view/new/rs-mmc.htm rs mmc card 512mb dual] [http://guest.rigour.info/library/html/jvc-grx/ jvc gr-x5] [http://up.rigour.info/description/lib/albergo-.htm albergo 3 stella copenhagen] [http://all.rigour.info/played-a/ played a life safari duo] [http://load.rigour.info/view/new/fatto-o.htm fatto o rifatto] [http://gratis.rigour.info/content/view/film-gratis.htm film gratis animal sexi] [http://dir.rigour.info/copay-secondo/ copay secondo] [http://blog.rigour.info/web/www-gemidos/ www gemidos com ar] [http://up.rigour.info/description/lib/novoaltajsk.htm novoaltajsk] [http://down.rigour.info/blog/tanto-la.htm tanto la queria de andy y lucas] [http://paga.rigour.info/lg-direct/ lg direct drive lavatrice] [http://note.rigour.info/content/view/custodia-chitarra.htm custodia chitarra] [http://here.rigour.info/blog/manuale-philips.htm manuale philips] [http://italy.rigour.info/blog/iceshelf.htm ice-shelf] [http://speed.rigour.info/linea-mani.htm linea mani lancome] [http://paga.rigour.info/testo-pgr/ testo pgr] [http://milano.rigour.info/engher-eva.htm engher eva] [http://speed.rigour.info/cellulare-supporto.htm cellulare supporto auto] [http://it.rigour.info/topic/sedia-iroko/ sedia iroko] [http://paga.rigour.info/la-natura/ la natura in goethe] [http://speed.rigour.info/pioneer-dehpmp.htm pioneer deh-p8600mp] [http://uve.rigour.info/blog/kobayashi-issa.htm kobayashi, issa] [http://uve.rigour.info/blog/te-quiero.htm te quiero te quiero] [http://uve.rigour.info/blog/lancia-z.htm lancia z] [http://all.rigour.info/defend/ defend] [http://uve.rigour.info/blog/km-chrysler.htm km0 chrysler pt cruiser auto km 0] [http://down.rigour.info/blog/video-free.htm video free hard] [http://pagina.rigour.info/navigatore-satellitare/ navigatore satellitare gps] [http://gratis.rigour.info/content/view/batman-del.htm batman del futuro] [http://it.rigour.info/topic/ferro-da/ ferro da stiro delonghi] [http://speed.rigour.info/chatta-erotica.htm chatta erotica] [http://load.rigour.info/view/new/in-due.htm in due parole] [http://load.rigour.info/view/new/meka.htm meka] [http://pagina.rigour.info/gianna-singole/ gianna singole] [http://speed.rigour.info/quadri-courbet.htm quadri courbet] [http://gratis.rigour.info/content/view/don-t.htm don t you worry] [http://down.rigour.info/blog/www-it.htm www it vodafon it] [http://it.rigour.info/topic/cagliari-milano/ cagliari milano linate biglietti aerei] [http://up.rigour.info/description/lib/hp-p.htm hp 5590p] [http://content.rigour.info/html/toner-epson/ toner epson al-c2000] [http://here.rigour.info/blog/bij.htm bij 2300] [http://it.rigour.info/topic/donna-con/ donna con lui cuckold] [http://uve.rigour.info/blog/nuovo-colombo.htm nuovo colombo] [http://web.rigour.info/bonders/ bonders] [http://dir.rigour.info/xxxporno/ xxxporno] [http://content.rigour.info/html/ms-office/ ms office small business] [http://pagina.rigour.info/epson-aculaser/ epson aculaser al-cx11n] [http://guest.rigour.info/library/html/nike-air/ nike air max automatic] [http://dir.rigour.info/porno-animali/ porno animali] [http://load.rigour.info/view/new/www-il.htm www il fiume po it] [http://content.rigour.info/html/tutto-wind/ tutto wind] [http://speed.rigour.info/ram-vdata.htm ram v-data] [http://pagina.rigour.info/igiene-degli/ igiene degli alimenti] [http://here.rigour.info/blog/mp-player.htm mp4 player] [http://down.rigour.info/blog/televisore-vendita.htm televisore vendita] [http://italy.rigour.info/blog/john-jeans.htm john jeans] [http://speed.rigour.info/dana-skully.htm dana skully] [http://online.rigour.info/passeggino-chicco/ passeggino chicco trio s3 top] [http://speed.rigour.info/in-partibus.htm in partibus infidelium] [http://content.rigour.info/html/incontri-a/ incontri a agrigento] [http://it.rigour.info/topic/nikon/ nikon 12 24] [http://blog.rigour.info/web/roma-vienna/ roma vienna] [http://uve.rigour.info/blog/wireless-schede.htm wireless schede acquisizione e tv] [http://milano.rigour.info/giada-de.htm giada de blanck] [http://guest.rigour.info/library/html/xeon/ xeon 3 4] [http://it.rigour.info/topic/lagosto-di/ lagosto di cecchi gori - 2] [http://blog.rigour.info/web/teenage-superstar/ teenage superstar] [http://speed.rigour.info/power-color.htm power color ati radeon 9600 pro] [http://down.rigour.info/blog/rimini-rimini.htm rimini rimini] [http://web.rigour.info/senza-mutandine/ senza mutandine] [http://speed.rigour.info/battiato-voglio.htm battiato voglio vederti danzare] [http://italy.rigour.info/blog/risng-force.htm risng force] [http://guest.rigour.info/library/html/oceaniche/ oceaniche] [http://guest.rigour.info/library/html/chanel-egoiste/ chanel egoiste platinum] [http://blog.rigour.info/web/mamas-and/ mamas and the papas california dreaming] [http://here.rigour.info/blog/nees-von.htm nees von esenbeck, christian ...] [http://paga.rigour.info/il-passaggio/ il passaggio del reno] [http://paga.rigour.info/singoli/ singoli 2004] [http://it.rigour.info/topic/i-m/ i m just a gigolo] [http://pagina.rigour.info/suzuki-gsx/ suzuki gsx r 600 del 2001] [http://pagina.rigour.info/m-jakson/ m jakson] [http://up.rigour.info/description/lib/nomination-srl.htm nomination srl] [http://up.rigour.info/description/lib/j-terni.htm j terni] [http://online.rigour.info/canon-/ canon - fotocamere digitali eos 20d ef-s] [http://pagina.rigour.info/giochi-/ giochi porno per donne] [http://web.rigour.info/fucili-subacquei/ fucili subacquei diving pesca] [http://web.rigour.info/rastaban/ rastaban] [http://milano.rigour.info/www-parseek.htm www parseek com] [http://down.rigour.info/blog/kings-of.htm kings of con] [http://gratis.rigour.info/content/view/marlowe-indaga.htm marlowe indaga] [http://here.rigour.info/blog/le-foto.htm le foto e gli avvenimenti della vita di] [http://up.rigour.info/description/lib/hamlet-notebook.htm hamlet notebook] [http://dir.rigour.info/stampante-epson/ stampante epson cd] [http://it.rigour.info/topic/scienze-giuridiche/ scienze giuridiche delle relazioni inte] [http://here.rigour.info/blog/liquido-per.htm liquido per allontanare i gatti] [http://it.rigour.info/topic/macchina-hot/ macchina hot dog] [http://paga.rigour.info/musica-italia/ musica italia] 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] | '''"([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. | ||
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 15:34, 21 August 2007
paglialunga cartuccia epson c60 notti di cabiria km0 rover discovery auto km 0 pelicula titanic orologio fasi lunari due assi nella manica laface enzo indesit wp 100 gigi and molly heterohyrax volvo varese buzzle dipinto paesaggio natacha galeria gratis chicos famosos neger bums mich moto mondiale r 1200 gs clara morgan nuda di max de angeli oakley crosshair work manowar wheels of fire gande fratello uk mulinello surf il croccodile come fa la colina de la vida de ataque 77 kenzo eau coppie over 50 grasse polistirolo prato polo jersey uomo t amo ps2 gt 4 laser hp stampante enterostomie frigorifero coca cola rossanna mitsubishi - pajero golden sun the o c telefilm palm te2 tamron 28-75mm gci net finanziamento berlin www aduc it reyno animal s3 racconti erotici moglie porte chiuse cooperative edilizie torino dying diana one t ft cool t the magic key epson stylus photo rx sms gain villa santantonio san remo 2002 profumi gucci spia spione calzature donna inverno 40 prada mercatino trieste ministerointerni the battle di hans zimmer apple mouse ingresso videocamere adsl2 firewall router giochi di avventura 3d distretto militare di salerno racchetta da tennis dunlop jonni giochi demo di strategia arei prealpi srl tammorriata pugni chiusi fr david kinkyman auto noleggio vigevano luci e ombre per il tokyo game show autunnale cachorros foto donne comuni nude stradale belluno volo lissone cheap obiettivi canon ef 55-200 dsc t7 sony photoshop 8 rav4 2002 tesi scienze statistiche reale mutua assicurazione racconti sculacciate rh 7900mh confessionale calendario costantino hydromania newport hotel amplificatori valvole verona trapano black decker cartuccia oro air 3 bud asus pda phone sostanza dimagranti fred dal whisky facile rs mmc card 512mb dual jvc gr-x5 albergo 3 stella copenhagen played a life safari duo fatto o rifatto film gratis animal sexi copay secondo www gemidos com ar novoaltajsk tanto la queria de andy y lucas lg direct drive lavatrice custodia chitarra manuale philips ice-shelf linea mani lancome testo pgr engher eva cellulare supporto auto sedia iroko la natura in goethe pioneer deh-p8600mp kobayashi, issa te quiero te quiero lancia z defend km0 chrysler pt cruiser auto km 0 video free hard navigatore satellitare gps batman del futuro ferro da stiro delonghi chatta erotica in due parole meka gianna singole quadri courbet don t you worry www it vodafon it cagliari milano linate biglietti aerei hp 5590p toner epson al-c2000 bij 2300 donna con lui cuckold nuovo colombo bonders xxxporno ms office small business epson aculaser al-cx11n nike air max automatic porno animali www il fiume po it tutto wind ram v-data igiene degli alimenti mp4 player televisore vendita john jeans dana skully passeggino chicco trio s3 top in partibus infidelium incontri a agrigento nikon 12 24 roma vienna wireless schede acquisizione e tv giada de blanck xeon 3 4 lagosto di cecchi gori - 2 teenage superstar power color ati radeon 9600 pro rimini rimini senza mutandine battiato voglio vederti danzare risng force oceaniche chanel egoiste platinum mamas and the papas california dreaming nees von esenbeck, christian ... il passaggio del reno singoli 2004 i m just a gigolo suzuki gsx r 600 del 2001 m jakson nomination srl j terni canon - fotocamere digitali eos 20d ef-s giochi porno per donne fucili subacquei diving pesca rastaban www parseek com kings of con marlowe indaga le foto e gli avvenimenti della vita di hamlet notebook stampante epson cd scienze giuridiche delle relazioni inte liquido per allontanare i gatti macchina hot dog musica italia 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.