<  February 2017   >
Su Mo Tu We Th Fr Sa  
          1  2  3  4  
 5  6  7  8  9 10 11  
12 13 14 15 16 17 18  
19 20 21 22 23 24 25  
26 27 28
01:50 netj joined
03:49 deepbook5broo joined
03:49 deepbook5broo left
04:01 netj joined
08:36 scippio joined
09:39 BearishMushroom joined
09:40 alexherbo2 joined
09:43 zerorax joined
10:12 tvw joined
10:14 tvw joined
10:15 tvw joined
10:18 tvw joined
10:20 tvw joined
10:41 alexherbo2 joined
10:44 MoskitoHero joined
12:00 MoskitoHero joined
12:28 opt9 joined
12:41 vlad1777d joined
12:57 tvw joined
14:05 opt9 joined
14:10 Gustavo6046 joined
14:19 netj joined
14:35 torbjorn joined
14:35 <torbjorn> how do I extract all captures from a regexp into an array?
14:48 <Lierdakil> torbjorn: [capture1, capture2, rest...] = /(1)(2)(3)(4)/.exec("1234").slice(1) ?
15:06 <torbjorn> Lierdakil: I'd need to make it /(\d)/g in your case
15:07 <torbjorn> my question was wrong, I need to capture all repeated captures in a regex with the global flag
15:07 <torbjorn> or so
15:07 <torbjorn> /(+d)/ on "1234" should give me ["1","2","3","4"]
15:11 <Lierdakil> torbjorn: this is a bit more involved. javascript regex returns global captures via successive calls to `exec`
15:11 <Lierdakil> so something like this maybe
15:12 <Lierdakil> rx = /(\d)/g
15:12 <Lierdakil> str = "1234"
15:12 <Lierdakil> result = (match[1] while (match = rx.exec str))
15:20 <Lierdakil> note that you *have* to define regexp before loop
15:21 <Lierdakil> but you don't have to do that with string
17:14 MoskitoHero joined
17:17 FunnyLookinHat joined
17:21 coffeescriptbot joined
17:21 <coffeescriptbot> [coffeescript] lydell pushed 2 new commits to master: https://git.io/vDHja
17:21 <coffeescriptbot> coffeescript/master f757614 Alan Pierce: Place ending heregex tokens one index earlier...
17:21 <coffeescriptbot> coffeescript/master 4f714cc Simon Lydell: Merge pull request #4444 from alangpierce/upstream-fix-heregex-end-location...
17:21 coffeescriptbot left
17:21 coffeescriptbot joined
17:21 <coffeescriptbot> [coffeescript] lydell pushed 2 new commits to master: https://git.io/vDHjr
17:21 <coffeescriptbot> coffeescript/master fbc77f7 Alan Pierce: Properly update location data when setting a call to use `new`...
17:21 <coffeescriptbot> coffeescript/master d84c94d Simon Lydell: Merge pull request #4445 from alangpierce/upstream-fix-new-location-data...
17:21 coffeescriptbot left
17:39 zerorax joined
18:23 <deltab> '1234'.match(/(\d)/g)
18:53 <Lierdakil> deltab: this won't extract captures though, only full matches
18:54 <Lierdakil> so parentheses are basically ignored
18:56 <deltab> torbjorn: could you give another example?
19:14 scippio joined
19:27 trojanc joined
19:47 sunoano1 joined
19:47 sunoano1 joined
20:23 scippio joined
20:31 sz0 joined
21:38 tvw joined
23:33 Gustavo6046_ joined