Skip to content

docs: fix d2:validatePattern escaping guidance - #1817

Merged
karolinelien merged 1 commit into
masterfrom
fix/validate-pattern-regex-escaping
Oct 2, 2026
Merged

karolinelien merged 1 commit into
masterfrom
fix/validate-pattern-regex-escaping

Conversation

@karolinelien

Copy link
Copy Markdown
Contributor

Related: https://dhis2.atlassian.net/browse/DHIS2-21359

Why

What

  • Examples use single backslashes. Added a note on the versions where backslashes had to be doubled: core before 2.41.9 / 2.42.6 / 2.43.2, Android Capture before 3.4.2, Capture web app before 106.2.3.
  • Corrected the example description from 9999/99/9 to 999999/99/9 to match \d{6}.
  • Same change on the Maintenance and Metadata Management program pages.

How verified

  • Version boundaries checked from the rule-engine version in dhis2-core pom.xml and capture-app yarn.lock at each tag. 2.43.2 is not released yet; it is taken from the patch/2.43.2 branch.
  • New examples tested with Java and JS regex full-match.

AI Assisted

Since expression-parser 1.4.2 (rule-engine 3.8.1, DHIS2-21359) the
regex argument of d2:validatePattern is used as written. The documented
double-backslash examples now fail to match or match everything.
Document single-backslash patterns and the versions where the old
doubling applied.

AI Assisted

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@karolinelien
karolinelien marked this pull request as ready for review September 29, 2026 14:46
@karolinelien
karolinelien merged commit 8d14a51 into master Oct 2, 2026
@karolinelien
karolinelien deleted the fix/validate-pattern-regex-escaping branch October 2, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants