3
3
## Preamble
4
4
5
5
Author: Karl Williamson <[email protected] >
6
- ID: KHW-0001
6
+ ID: 0026
7
7
Status: Draft
8
8
9
9
## Abstract
@@ -32,7 +32,7 @@ fixes that.
32
32
## Specification
33
33
34
34
I propose adding a new opt-in feature. Call it, for now, "feature
35
- enhanced_re_xx". Within its scope, the /xx modifier would change things so
35
+ ` enhanced_re_xx ` ". Within its scope, the /xx modifier would change things so
36
36
that inside a bracketed character class [ ...] , any vertical space would be
37
37
treated as a blank, essentially ignored. Any unescaped '#' would begin a
38
38
comment that ends at the end of the line.
@@ -45,25 +45,31 @@ would be raised.
45
45
46
46
And an unescaped '#' within a comment would raise a warning. So
47
47
48
+ ```
48
49
$a[$i] =~ qr/ [ a-z # We need to match the lowercase alphabetics
49
50
! @ # . * # And certain punctuation
50
51
0-9 # And the digits (which can only occur in $a[0])
51
52
]
52
53
/xx;
54
+ ```
53
55
54
56
would warn.
55
57
56
58
It might be that an unescaped '#' that isn't of the form \s+#\s+ should
57
59
warn to catch things like if the above example's second line were just
58
60
61
+ ```
59
62
!@#.*
63
+ ```
60
64
61
65
Also, any comments inside [ ...] would check for an unescaped '] ' on the same
62
66
line after a '#', and raise a warning if found. So, something like
63
67
68
+ ```
64
69
$a[$i] =~ qr/ [ a-z # . * ]
65
70
[ A-Z ]
66
71
/xx;
72
+ ```
67
73
68
74
would warn. Either escape the '#' or the '] ' to suppress it, depending on what
69
75
your intent was.
0 commit comments