regexp-examples 0.2.4 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57d9fba55197325b1b40db482d14f45b0c3907a3
4
- data.tar.gz: 3b323dab50c314d42b99300169dfc02bbf084645
3
+ metadata.gz: 070f108bdf60292bcb76bfcfc9036d7681f46844
4
+ data.tar.gz: cd09253f3ec4c272e4e6dd895c69334def2d3321
5
5
  SHA512:
6
- metadata.gz: 6e872cc1a32c5c0582909e8cd8587806a1bb03c33cd3f15dc94f717db9eb58d0636b1f34993d1fc30752c63a445e7911fa3d4d5e6f6d420f271d8d6f20d3affb
7
- data.tar.gz: e04349b682c70ba5b4bc62290ba2476357ccc6f1e611df103f535df9ca1aad243ed76d7ca4013f461e67fd87996765b29a1fea063fede0df3830e8973dba78f5
6
+ metadata.gz: c984b1d6dab4488368d85373099cd5c64e2406cd4f100957cfa413662e4f78307bfa1a06a641d670c0e9fc7e0bc9821c10acd34851f6408d9afbde44b0b72b66
7
+ data.tar.gz: 77b51a5c67c4b1a1a357a123049848a43e4bcf29f89aa2cc3ba3272f6e032d1ea5e7363317e7ce38b0af5741ffcc190604cace8a79108e0ccd8c83682ddc71d8
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0-p598
4
+ - 2.1.5
5
+ - ruby-head
data/README.md CHANGED
@@ -39,17 +39,17 @@ or a huge number of possible matches, such as `/.\w/`, then only a subset of the
39
39
  * ...And backreferences(!!!), e.g. `/(this|that) \1/` `/(?<name>foo) \k<name>/`
40
40
  * Groups work fine, even if nested! e.g. `/(even(this(works?))) \1 \2 \3/`
41
41
  * Control characters, e.g. `/\ca/`, `/\cZ/`, `/\C-9/`
42
- * Escape sequences, e.g. `/\x42/`, `/\x3D/`, `/\5word/`, `/#{"\x80".force_encoding("ASCII-8BIT")}/`
43
- * Unicode characters, e.g. `/\u0123/`, `/\uabcd/`
42
+ * Escape sequences, e.g. `/\x42/`, `/\x3D/`, `/\x5word/`, `/#{"\x80".force_encoding("ASCII-8BIT")}/`
43
+ * Unicode characters, e.g. `/\u0123/`, `/\uabcd/`, `/\u{789}/`
44
44
  * **Arbitrarily complex combinations of all the above!**
45
45
 
46
46
  ## Not-Yet-Supported syntax
47
47
 
48
- I plan to add the following features to the gem, but have not yet got round to it:
48
+ * Options, e.g. `/pattern/i`, `/foo.*bar/m` - Using options will currently just be ignored, e.g. `/test/i.examples` will NOT include `"TEST"`
49
+
50
+ Using any of the following will raise an RegexpExamples::UnsupportedSyntax exception (until such time as they are implemented!):
49
51
 
50
- * Throw exceptions if illegal syntax (see below) is used. This is currently only partially implemented (for lookarounds only).
51
52
  * POSIX bracket expressions, e.g. `/[[:alnum:]]/`, `/[[:space:]]/`
52
- * Options, e.g. `/pattern/i`, `/foo.*bar/m`
53
53
  * Named properties, e.g. `/\p{L}/` ("Letter"), `/\p{Arabic}/` ("Arabic character"), `/\p{^Ll}/` ("Not a lowercase letter")
54
54
  * Subexpression calls, e.g. `/(?<name> ... \g<name>* )/` (Note: These could get _really_ ugly to implement, and may even be impossible, so I highly doubt it's worth the effort!)
55
55
 
@@ -58,8 +58,11 @@ I plan to add the following features to the gem, but have not yet got round to i
58
58
  The following features in the regex language can never be properly implemented into this gem because, put simply, they are not technically "regular"!
59
59
  If you'd like to understand this in more detail, there are many good blog posts out on the internet. The [wikipedia entry](http://en.wikipedia.org/wiki/Regular_expression)'s not bad either.
60
60
 
61
- * Lookarounds, e.g. `/foo(?=bar)/`, `/(?<!foo)bar/`
62
- * Anchors, e.g. `/\bword\b/`, `/line1\n^line2/` (although a special case could perhaps be made to allow `\A`, `^`, `\z` and `$` at the beginning/end of the pattern)
61
+ Using any of the following will raise an RegexpExamples::IllegalSyntax exception:
62
+
63
+ * Lookarounds, e.g. `/foo(?=bar)/`, `/foo(?!bar)/`, `/(?<=foo)bar/`, `/(?<!foo)bar/`
64
+ * [Anchors](http://ruby-doc.org/core-2.2.0/Regexp.html#class-Regexp-label-Anchors) (`\b`, `\B`, `\G`, `^`, `\A`, `$`, `\z`, `\Z`), e.g. `/\bword\b/`, `/line1\n^line2/`
65
+ * However, a special case has been made to allow `^` and `\A` at the start of a pattern; and to allow `$`, `\z` and `\Z` at the end of pattern. In such cases, the characters are effectively just ignored.
63
66
 
64
67
  (Note: Backreferences are not really "regular" either, but I got these to work with a bit of hackery!)
65
68
 
@@ -16,19 +16,19 @@
16
16
  null,
17
17
  null,
18
18
  1,
19
- 290,
20
- 290,
21
- 168,
22
- 241,
19
+ 319,
20
+ 319,
21
+ 191,
22
+ 264,
23
23
  null,
24
24
  null,
25
25
  null,
26
26
  1,
27
- 241,
28
- 241,
27
+ 264,
28
+ 264,
29
29
  null,
30
30
  null,
31
- 241,
31
+ 264,
32
32
  null,
33
33
  null,
34
34
  null
@@ -38,28 +38,28 @@
38
38
  1,
39
39
  1,
40
40
  1,
41
- 290,
41
+ 360,
42
42
  null,
43
43
  null,
44
44
  1,
45
- 290,
46
- 290,
47
- 290,
48
- 320,
49
- 434,
45
+ 319,
46
+ 319,
47
+ 319,
48
+ 349,
49
+ 463,
50
50
  null,
51
51
  null,
52
- 290,
52
+ 319,
53
53
  null,
54
54
  null,
55
55
  null,
56
56
  1,
57
57
  1,
58
- 265,
58
+ 335,
59
59
  null,
60
60
  null,
61
61
  1,
62
- 265,
62
+ 294,
63
63
  null,
64
64
  null,
65
65
  null,
@@ -117,11 +117,11 @@
117
117
  1,
118
118
  1,
119
119
  1,
120
- 69,
121
- 165,
120
+ 75,
121
+ 171,
122
122
  28,
123
123
  null,
124
- 165,
124
+ 171,
125
125
  null,
126
126
  null,
127
127
  null,
@@ -192,48 +192,60 @@
192
192
  1,
193
193
  1,
194
194
  1,
195
- 73,
196
- 73,
197
- 73,
195
+ 92,
196
+ 92,
197
+ 92,
198
198
  null,
199
199
  null,
200
200
  1,
201
- 120,
202
- 120,
203
- 335,
204
- 331,
205
- 290,
206
- 290,
207
- 290,
201
+ 140,
202
+ 140,
203
+ 419,
204
+ 401,
205
+ 360,
206
+ 360,
207
+ 360,
208
208
  null,
209
- 116,
209
+ 122,
210
210
  null,
211
211
  null,
212
212
  1,
213
213
  null,
214
214
  1,
215
- 335,
216
- 335,
215
+ 419,
216
+ 419,
217
217
  null,
218
- 45,
218
+ 46,
219
219
  null,
220
220
  41,
221
221
  null,
222
- 14,
222
+ 15,
223
223
  null,
224
- 1,
224
+ 4,
225
225
  null,
226
226
  6,
227
227
  null,
228
- 49,
228
+ 63,
229
+ null,
230
+ 2,
231
+ 1,
232
+ null,
233
+ 1,
234
+ null,
235
+ null,
236
+ 2,
237
+ 1,
238
+ null,
239
+ 1,
240
+ null,
229
241
  null,
230
- 179,
242
+ 240,
231
243
  null,
232
- 331,
244
+ 401,
233
245
  null,
234
246
  null,
235
247
  1,
236
- 49,
248
+ 63,
237
249
  null,
238
250
  null,
239
251
  19,
@@ -245,25 +257,45 @@
245
257
  14,
246
258
  null,
247
259
  null,
248
- null,
249
260
  8,
250
261
  8,
251
262
  null,
252
263
  3,
253
264
  3,
254
265
  null,
266
+ 3,
267
+ 3,
268
+ 3,
269
+ null,
270
+ 3,
271
+ 3,
272
+ null,
273
+ null,
274
+ 1,
275
+ null,
276
+ 3,
277
+ null,
278
+ 2,
279
+ 1,
280
+ null,
281
+ 1,
282
+ null,
283
+ null,
284
+ 4,
255
285
  2,
286
+ null,
256
287
  2,
257
288
  null,
289
+ null,
258
290
  2,
259
291
  null,
260
- 49,
261
- 49,
292
+ 63,
293
+ 53,
262
294
  null,
263
295
  null,
264
296
  1,
265
- 290,
266
- 290,
297
+ 360,
298
+ 360,
267
299
  null,
268
300
  5,
269
301
  null,
@@ -273,16 +305,16 @@
273
305
  null,
274
306
  5,
275
307
  null,
276
- 265,
308
+ 335,
277
309
  null,
278
- 290,
310
+ 360,
279
311
  null,
280
312
  null,
281
313
  1,
282
- 45,
283
- 45,
284
- 45,
285
- 45,
314
+ 46,
315
+ 46,
316
+ 46,
317
+ 46,
286
318
  null,
287
319
  null,
288
320
  38,
@@ -294,11 +326,11 @@
294
326
  null,
295
327
  2,
296
328
  null,
297
- 2,
298
- 2,
299
- 45,
329
+ 3,
330
+ 3,
331
+ 46,
300
332
  null,
301
- 41,
333
+ 42,
302
334
  41,
303
335
  null,
304
336
  null,
@@ -307,6 +339,9 @@
307
339
  null,
308
340
  null,
309
341
  1,
342
+ 15,
343
+ 1,
344
+ null,
310
345
  14,
311
346
  14,
312
347
  14,
@@ -328,7 +363,7 @@
328
363
  null,
329
364
  null,
330
365
  1,
331
- 1,
366
+ 4,
332
367
  null,
333
368
  null,
334
369
  1,
@@ -339,7 +374,7 @@
339
374
  null,
340
375
  null,
341
376
  1,
342
- 194,
377
+ 261,
343
378
  null,
344
379
  null,
345
380
  1,
@@ -356,7 +391,7 @@
356
391
  null,
357
392
  null,
358
393
  1,
359
- 2,
394
+ 3,
360
395
  null,
361
396
  null,
362
397
  1,
@@ -384,11 +419,11 @@
384
419
  null,
385
420
  null,
386
421
  1,
387
- 265,
422
+ 335,
388
423
  null,
389
424
  null,
390
425
  1,
391
- 155,
426
+ 293,
392
427
  null,
393
428
  null,
394
429
  null,
@@ -402,31 +437,31 @@
402
437
  1,
403
438
  1,
404
439
  1,
405
- 1677,
406
- 1677,
407
- 1677,
440
+ 1758,
441
+ 1758,
442
+ 1758,
408
443
  122,
409
444
  null,
410
- 1677,
445
+ 1758,
411
446
  null,
412
447
  null,
413
448
  1,
414
- 1683,
449
+ 1775,
415
450
  null,
416
451
  null,
417
452
  null,
418
453
  null,
419
454
  1,
420
- 434,
455
+ 463,
421
456
  null,
422
457
  null,
423
458
  null,
424
459
  1,
425
460
  1,
426
- 194,
461
+ 261,
427
462
  null,
428
463
  1,
429
- 194,
464
+ 223,
430
465
  null,
431
466
  null,
432
467
  null,
@@ -545,12 +580,12 @@
545
580
  1,
546
581
  1,
547
582
  1,
548
- 73,
583
+ 92,
549
584
  null,
550
585
  null,
551
- 133,
552
- 69,
553
- 69,
586
+ 162,
587
+ 75,
588
+ 75,
554
589
  null,
555
590
  null,
556
591
  1,
@@ -560,11 +595,11 @@
560
595
  "/home/tom/git/regexp-examples/spec/regexp-examples_spec.rb": [
561
596
  1,
562
597
  1,
563
- 10,
564
- 69,
565
- 69,
566
- 69,
567
- 234,
598
+ 11,
599
+ 75,
600
+ 75,
601
+ 75,
602
+ 246,
568
603
  null,
569
604
  null,
570
605
  null,
@@ -575,8 +610,16 @@
575
610
  null,
576
611
  1,
577
612
  1,
578
- 4,
579
- 8,
613
+ 12,
614
+ 24,
615
+ null,
616
+ null,
617
+ null,
618
+ null,
619
+ 1,
620
+ 1,
621
+ 5,
622
+ 10,
580
623
  null,
581
624
  null,
582
625
  null,
@@ -682,6 +725,34 @@
682
725
  null,
683
726
  null,
684
727
  null,
728
+ null,
729
+ null,
730
+ null,
731
+ null,
732
+ null,
733
+ null,
734
+ null,
735
+ null,
736
+ 1,
737
+ 1,
738
+ null,
739
+ null,
740
+ null,
741
+ null,
742
+ null,
743
+ null,
744
+ null,
745
+ null,
746
+ 1,
747
+ 1,
748
+ null,
749
+ null,
750
+ null,
751
+ null,
752
+ null,
753
+ null,
754
+ null,
755
+ null,
685
756
  1,
686
757
  1,
687
758
  null,
@@ -712,9 +783,10 @@
712
783
  null,
713
784
  null,
714
785
  null,
786
+ null,
715
787
  null
716
788
  ]
717
789
  },
718
- "timestamp": 1421512650
790
+ "timestamp": 1421519798
719
791
  }
720
792
  }