Commit Graph

15 Commits

Author SHA1 Message Date
Nicholas Wilson
eb3bd3cf14 New pcre2_next_match() API to simplify pcre2demo, test, and substitute (#733)
* The primary purpose of pcre2_next_match() is to make it much easier for
  PCRE2 clients to iterate over matches, without needing an advanced knowledge
  of regular expressions.
* Secondly, we can simplify our own code by merging the three duplicate
  implementations of the /g global match behaviour: pcre2demo, pcre2_substitute,
  and pcre2test.
* Thirdly, as I look closely at the issue, I can improve the documentation.
* Fourthly, I would like to actually simplify the logic, removing a complex loop
  which makes several match attempts, swallows duplicate matches, and more.
  We can have identical behaviour with a simple retry using
  PCRE2_NOTEMPTY_ATSTART.
2025-03-24 13:29:52 +00:00
Nicholas Wilson
03a00fd407 A few further tweaks to Zig 0.14 support (#731)
Followup to #722

* Fix Windows build warning by adding PCRE2_STATIC to pcre2test
* Remove unnecessary `.linkLibc()` command, now that we have `link_libc = true` in the Module declarations
* Update the old `std.Build.Step.Compile.create(...)` calls to the brand-new `b.addLibrary(...)` function. They added this exactly for our use-case, to allow dynamically selecting between `addStaticLibrary/addDynamicLibrary` variants.
* Bump zig stack usage in CI
2025-03-17 20:23:59 +00:00
Rocco Ruscitti
fa68936317 Update build.zig for release of 0.14.0 breaking language changes (#724)
With the release of zig 0.14.0, there are some breaking changes to syntax in build.zig.

Here, we drop support for zig 0.13, and add support for 0.14. There does not seem to be any advantage to try and support both simultaneously (nor did the zig maintainers make this easy).

---

Co-authored-by: qaptoR <rocco.ruscitti@outlook.com>
2025-03-17 16:15:16 +00:00
Zoltan Herczeg
861a8aae41 Improve named group handling (#700)
Add a simple hash code for group names to improve search speed.
Ignore duplicates when group names are searched.
Improve finding of duplicates (they have the same name pointer).
Improve creating name table (duplicates are handled in one step).
Create a new file for name management.
2025-02-18 18:04:14 +01:00
Nicholas Wilson
f724b6117b Declutter one cmake file (#662) 2025-01-11 10:29:49 +00:00
Nicholas Wilson
413bd8a6ee Add zig build to CI (#622)
It's not ideal, but at least it's being tested. I have added support for pcre2test, so that we can run the unit tests against the library which Zig builds.
2024-12-17 11:10:06 +00:00
Zoltan Herczeg
d3095b4761 Improve character classes (#474)
Co-authored-by: Zoltan Herczeg <hzmester@freemail.hu>
2024-09-21 14:26:49 +01:00
player-two
967804bbfa update build.zig to support zig 0.13.0 (#416)
The cache director is now prefixed with a .[0]

Also, std.Build.LazyPath has changed, and now the recommended way to create one
that is relative to the repo root is via std.Build.path().

[0]: https://ziglang.org/download/0.13.0/release-notes.html#codezig-cachecode-renamed-to-codezig-cachecode

Co-authored-by: Jordan Griege <>
2024-06-11 16:49:34 +01:00
player-two
9fc7708aa8 update build.zig to support zig 0.12.0 (#408)
This is the only breaking change since the previous update

https://ziglang.org/documentation/0.12.0/std/#std.Build.Step.Compile.installHeader

Co-authored-by: Jordan Griege <>
2024-04-26 08:56:41 +01:00
Tristan Ross
3c5ca5c1ea Update build.zig to support latest master (#395) 2024-03-15 16:59:58 +00:00
Tristan Ross
589fea34c8 Improve Zig build & support latest Zig (#383)
Adds static linking, better handling of copied files, and support latest
Zig compiler.
2024-02-18 16:27:35 +00:00
Kristian Larsson
2cc772a4ec Update to latest zig (#262)
* Update to latest zig

* Adopt build.zig to zig v0.11

Zig v0.11 is released, so let's upgrade!
2023-08-15 16:07:56 +01:00
star-tek-mb
512be06078 update to latest zig (#219) 2023-03-29 10:19:48 +01:00
Philip Hazel
38f33a4932 Remove pcre2_ucptables.c from explicit building by Bazel and zig (its 2023-03-22 17:54:00 +00:00
star-tek-mb
a649cbc96e zig build support (#206) 2023-02-09 17:11:00 +00:00