Commit 5b16020
feat(stdlib): add re (regular expressions) module bindings (#273)
* feat(stdlib): add re (regular expressions) module bindings
Adds F# bindings for Python's re module, covering:
- Match object: group(), groups(), groupdict(), start(), end(), span(),
expand(), string, pos, endpos, lastindex, lastgroup
- Pattern object: match(), search(), fullmatch(), findall(), finditer(),
sub(), subn(), split(), pattern, flags, groups, groupindex
- Module-level functions: compile, match, search, fullmatch, findall,
finditer, sub, subn, split, escape, purge
- Flags module: IGNORECASE/I, MULTILINE/M, DOTALL/S, ASCII/A,
LOCALE/L, UNICODE/U, VERBOSE/X, NOFLAG
Also adds 42 tests in test/TestRegex.fs covering all key APIs.
Note: CHANGELOG.md is intentionally not updated per repository policy.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* refactor(stdlib): drop redundant Emit attrs in Regex bindings
Strip [<Emit>] attributes that simply reproduce the default Fable
codegen (positional-only IExports overloads with flags, string-key
Match accessors, no-arg `end()`). Per BINDINGS_GUIDE.md and the
Random.fs convention, [<Emit>] should only appear when it changes
generated output (int casts, keyword args, list wraps).
Also collapse the duplicate-literal short flag aliases
([<Literal>] let I = 2) into literal aliases of the long names
([<Literal>] let I = IGNORECASE) so the integer values live in
one place.
Generated Python is byte-identical for the affected sites; all
430 tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Dag Brattli <dag@brattli.net>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8c11d74 commit 5b16020
4 files changed
Lines changed: 677 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
0 commit comments