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
- Implement [`under ⍜`](https://uiua.org/docs/under)[`regex`](https://uiua.org/docs/regex) for replacing using regex (called `gsub` in some other languages)
51
52
### Interpreter
52
53
- Speed up the implementation of [`or ∨`](https://uiua.org/docs/or)
53
54
- The fomatter no longer truncates trailing decimal `0`s from number literals
Copy file name to clipboardExpand all lines: parser/src/defs.rs
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2610,12 +2610,15 @@ primitive!(
2610
2610
/// ex: regex "hi" "dog"
2611
2611
/// : △.
2612
2612
/// ex: regex "[a-z]+" "hello world"
2613
-
/// Escaped regex characters must be double-escaped.
2613
+
/// If the pattern contains escaped characters such as `\w`, either these must be doubleescaped or the whole pattern must be represented with a raw string.
2614
2614
/// ex: regex "\\d+" "123"
2615
-
/// ex: P ← $"(\\d{_})"
2615
+
/// ex: P ← $$ (\d{_})
2616
2616
/// : regex $"_-_-_"P3P3P4 "123-456-7890"
2617
2617
/// Regex patterns with optional captures can be used with [fill].
2618
2618
/// ex: ⬚""regex "a(b)?" "a ab"
2619
+
/// [under] can be used to run arbitrary regex-based substitutions.
2620
+
/// ex: Lorem
2621
+
/// : ⍜regex≡(□⊂⋅⊙⇌°□₃) $ (\w)(\w+)
2619
2622
///
2620
2623
/// Uiua uses the [Rust regex crate](https://docs.rs/regex/latest/regex/) internally.
0 commit comments