You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/blog/pomsky-0-12/index.md
+7-10Lines changed: 7 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: 'Pomsky 0.12'
3
3
description: 'See what’s new in Pomsky 0.12'
4
4
excerpt: >
5
-
I am delighted to announce version 0.12 of Pomsky, the next level regular expression language! Pomsky makes it easier than ever to write _correct_ and _maintainable_ regular expressions. Pomsky expressions are transpiled to regexes and can be used with many regex engines.
5
+
I am happy to announce version 0.12 of Pomsky, the next level regular expression language! Pomsky makes it easier than ever to write _correct_ and _maintainable_ regular expressions. Pomsky expressions are transpiled to regexes and can be used with many regex engines.
6
6
7
7
This release comes packed with new features and improvements. Here are the highlights:
8
8
@@ -27,7 +27,7 @@ date: 2024-12-18T10:00:00Z
27
27
draft: true
28
28
---
29
29
30
-
I am delighted to announce version 0.12 of Pomsky, the next level regular expression language! Pomsky makes it easier than ever to write _correct_ and _maintainable_ regular expressions. Pomsky expressions are transpiled to regexes and can be used with many regex engines.
30
+
I am happy to announce version 0.12 of Pomsky, the next level regular expression language! Pomsky makes it easier than ever to write _correct_ and _maintainable_ regular expressions. Pomsky expressions are transpiled to regexes and can be used with many regex engines.
31
31
32
32
## What's new?
33
33
@@ -51,15 +51,13 @@ This release comes packed with new features and improvements. Here are the highl
51
51
52
52
</div>
53
53
54
-
This release also has a breaking change, [explained below](#breaking-change-fixing-hygiene).
55
-
56
54
If you're unfamiliar with Pomsky, [here is a summary](/docs/get-started/quick-reference) of how Pomsky compares to regexes.
57
55
58
56
Let's look at the most exciting new features in this release!
59
57
60
58
## RE2 Support
61
59
62
-
RE2 is a fast regex engine from Google. Unlike backtracking regex engines such as PCRE2, it is based on finite automata, so it has better worst-case performance. Go's `regexp` package is (mostly[^1]) compatible with RE2. Pomsky now also offers a **RE2 flavor**, so you get better diagnostics when targeting RE2. For example, RE2 doesn't support features such as lookbehind, and Pomsky detects this:
60
+
RE2 is a fast regex engine from Google. Unlike backtracking regex engines such as PCRE2, it is based on finite automata, so it has better worst-case performance. Pomsky now offers a **RE2 flavor**, which is also compatible with Go's `regexp` package. Because the RE2 flavor doesn't support advanced features such as lookbehind and backreferences, Pomsky produces an error when you try to use them:
@@ -85,7 +83,7 @@ With RE2, Pomsky now supports 8 regex flavors, covering most mainstream programm
85
83
86
84
## Character Set Intersection
87
85
88
-
Several regex engines[^2] support intersecting and subtracting character sets:
86
+
Several regex engines[^1] support intersecting and subtracting character sets:
89
87
90
88
```regexp
91
89
[\p{Thai}&&\p{Nd}]
@@ -114,7 +112,7 @@ Note that not all flavors support intersection. However, if both character sets
114
112
115
113
Most software has to handle text in different languages and scripts. That's why we have always counted good Unicode support as one of Pomsky's killer features. For example, Pomsky polyfills `\w`#re in JavaScript, which is not Unicode aware even with the `unicode` flag.
116
114
117
-
Pomsky also makes it easy to match a code point in a particular Unicode script: For example, `[Syriac]`#po matches all Syriac characters—_in theory:_ Unicode scripts cannot overlap, so code points that would belong in multiple scripts are assigned to the `Common` or `Inherited` script instead.
115
+
Pomsky also makes it easy to match a code point in a particular Unicode script. For example, `[Syriac]`#po matches all Syriac characters—_in theory:_ Unicode scripts cannot overlap, so code points that would belong in multiple scripts are assigned to the `Common` or `Inherited` script instead.
118
116
119
117
[Script Extensions](https://www.unicode.org/L2/L2011/11406-script-ext.html) solve this problem, which Pomsky now supports:
120
118
@@ -225,7 +223,7 @@ However, we discovered that [modifiers](https://pomsky-lang.org/docs/language-to
225
223
```pomsky
226
224
let variable = .*;
227
225
228
-
(enable lazy; variable);
226
+
(enable lazy; variable)
229
227
```
230
228
231
229
Is the repetition in line 1 lazy or not? In Pomsky 0.11, it was lazy, which is counterintuitive because the `enable lazy;`#po statement is not in scope where the repetition appears, only where the variable is used.
@@ -242,5 +240,4 @@ We have a lot of exciting plans to make Pomsky a success. To realize them, we ne
242
240
243
241
Consider [**sponsoring me**](https://github.com/sponsors/Aloso) to help making my open-source work financially sustainable. Thank you ❤️
244
242
245
-
[^1]: Go's `regexp` package doesn't support `\C` from RE2 (matching a single byte, which isn't supported in Pomsky either).
246
-
[^2]: Character set intersection is supported in the JavaScript, Java, Ruby, and Rust flavors. Note that JavaScript requires the [v flag](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicodeSets) for this.
243
+
[^1]: Character set intersection is supported in the JavaScript, Java, Ruby, and Rust flavors. Note that JavaScript requires the [v flag](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicodeSets) for this.
0 commit comments