61 Commits

Author SHA1 Message Date
Eyüp Can Akman 2d5e77deb2 expr: avoid panic on regex retry-limit
Treat onig retry-limit-in-match errors as no match. GNU expr returns exit 1 for the same input.

Fixes #11612
2026-04-15 16:11:18 +02:00
Can Bölük 76b2f7877f expr: fix eager evaluation of parenthesized dead branches (#11395)
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2026-04-03 12:13:24 +02:00
Chris Dryden e5bf248762 expr: fix regex matching on inputs containing newlines (#10543) 2026-01-30 16:39:09 +01:00
Laurent Cheylus 6130a334f2 expr: fix crash for test_long_input on OpenBSD
Signed-off-by: Laurent Cheylus <foxy@free.fr>
2025-11-09 08:53:55 +01:00
Sylvestre Ledru 091db2babc expr: fix some multibyte issues and refactor a bit
Should make tests/expr/expr-multibyte pass

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-09-14 01:12:57 +02:00
Sylvestre Ledru 3ed1f47de3 add more emoji tests 2025-09-03 22:39:21 +02:00
Dorian Peron 4ab3431d08 test(expr): add locale-related tests, remove deprecated tests
- Add locale comparison test (issue #5378)
- Implement GNU expr-multibyte test
2025-07-09 15:34:07 +02:00
Dorian Peron 6e23d4e979 tests: patch tests to simplify imports 2025-07-01 03:36:46 +02:00
Tomasz Guz b5e0304ea7 expr: fix builtin functions precedence 2025-06-13 14:51:25 +02:00
Tomasz Guz 6049bc091a expr: fix substr parsing 2025-06-11 22:53:24 +02:00
Teemu Pätsi 4946922c0f expr: Fix error message for large numbers as range index 2025-05-27 17:28:19 +03:00
Teemu Pätsi 07caa4867b expr: Fix error message for too big range quantifier index 2025-05-27 14:06:15 +03:00
Teemu Pätsi b1a91351bc expr: Ignore test cases from spell checker 2025-05-27 04:34:38 +03:00
Teemu Pätsi bbc912eb75 expr: Add tests for regex range quantifiers 2025-05-27 04:26:37 +03:00
Teemu Pätsi aae62072d8 expr: Fix parsing range quantifiers in regex 2025-05-26 15:59:35 +03:00
Teemu Pätsi 63ce37cf6e expr: Refactor regex tests into multiple targeted functions 2025-05-24 11:17:39 +03:00
Teemu Pätsi b0390fe36e expr: Handle $ at the beginning of the regex pattern 2025-05-24 01:47:35 +03:00
Teemu Pätsi 4555e6fe48 expr: Handle trailing backslash error 2025-05-24 01:47:30 +03:00
Teemu Pätsi 29332865a9 expr: Handle special cases for $ in regex
Enable fixed test `test_bre11`
2025-05-23 15:29:55 +03:00
Teemu Pätsi f664578a4b expr: Handle special cases for ^ in regex 2025-05-23 15:23:21 +03:00
Teemu Pätsi 4ee53acad0 expr: Fix parsing negated character classes "[^a]" (#7884)
* expr: Fix regex escape logic

We have to track if the previous character was already escaped to determine
if the '\' character should be interpreted as an escape character.

* expr: Fix parsing caret (^) as character class negation token

* expr: Add tests for parsing carets in regex

* expr: Add missing semicolon

* expr: Simplify boolean assignment

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-05-04 17:35:18 +02:00
Dorian Péron f49e120877 Merge pull request #7846 from frendsick/fix/expr-regex-option-singleline
expr: Fix regex anchor matching behavior with `REGEX_OPTION_SINGLELINE`
2025-05-02 13:35:10 +02:00
Teemu Pätsi 07501be4ae expr: Escape anchor characters within pattern (#7842)
* expr: Escape anchor characters within the core pattern

The anchor characters `^` and `$` are not considered special characters by `expr`
unless they are used as expected on the start or end of the pattern.
2025-04-27 23:52:35 +02:00
Teemu Pätsi c6e2f9fd9a expr: Enable ignored test_anchor test 2025-04-26 18:28:21 +03:00
Sylvestre Ledru a0179ea239 uutests: adjust the tests to use them 2025-03-28 21:40:31 +01:00