masklinn í dag viðrar vel til loftárása |
Cette RE fonctionne très bien si ton langage gère les PCRE
Demo:
Python
Code :
>>> import re >>> matcher = re.compile('"(.+?)"\s+"(.+?)"') >>> matcher.match('"blublu" "bmabla"').groups() ('blublu', 'bmabla') >>> matcher.match('"This is the rythm" "of the night"').groups() ('This is the rythm', 'of the night') >>> matcher.match('"Harko est un" "gros phenos"').groups() ('Harko est un', 'gros phenos') >>>
|
JS
Code :
> '"Harko est un" "phenos"'.match(/"(.+?)"\s+"(.+?)"/) "Harko est un" "phenos",Harko est un,phenos > '"This is the rythm" "of the night"'.match(/"(.+?)"\s+"(.+?)"/) "This is the rythm" "of the night",This is the rythm,of the night
|
Ruby
Code :
irb(main):014:0> /"(.+?)"\s+"(.+?)"/.match('"Harko est un" "phenos"').to_a => ["\"Harko est un\" \"phenos\"", "Harko est un", "phenos"] irb(main):015:0> /"(.+?)"\s+"(.+?)"/.match('"blublu" "bmabla"').to_a => ["\"blublu\" \"bmabla\"", "blublu", "bmabla"] irb(main):016:0>
|
---------------
Stick a parrot in a Call of Duty lobby, and you're gonna get a racist parrot. — Cody
|