Skip to content

Commit 8f647e7

Browse files
committed
update PPC id, and minor Markdown fixes
1 parent 1e5e035 commit 8f647e7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ppcs/ppc0026-enhanced-regex-xx.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Preamble
44

55
Author: Karl Williamson <[email protected]>
6-
ID: KHW-0001
6+
ID: 0026
77
Status: Draft
88

99
## Abstract
@@ -32,7 +32,7 @@ fixes that.
3232
## Specification
3333

3434
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
3636
that inside a bracketed character class [...], any vertical space would be
3737
treated as a blank, essentially ignored. Any unescaped '#' would begin a
3838
comment that ends at the end of the line.
@@ -45,25 +45,31 @@ would be raised.
4545

4646
And an unescaped '#' within a comment would raise a warning. So
4747

48+
```
4849
$a[$i] =~ qr/ [ a-z # We need to match the lowercase alphabetics
4950
! @ # . * # And certain punctuation
5051
0-9 # And the digits (which can only occur in $a[0])
5152
]
5253
/xx;
54+
```
5355

5456
would warn.
5557

5658
It might be that an unescaped '#' that isn't of the form \s+#\s+ should
5759
warn to catch things like if the above example's second line were just
5860

61+
```
5962
!@#.*
63+
```
6064

6165
Also, any comments inside [...] would check for an unescaped ']' on the same
6266
line after a '#', and raise a warning if found. So, something like
6367

68+
```
6469
$a[$i] =~ qr/ [ a-z # . * ]
6570
[ A-Z ]
6671
/xx;
72+
```
6773

6874
would warn. Either escape the '#' or the ']' to suppress it, depending on what
6975
your intent was.

0 commit comments

Comments
 (0)