Overview
| Artifact ID: | 64798a81fae509e131d8b50bed90d2c25dd63a35cb44c262aabf09adeb783219 |
|---|---|
| Ticket: | 860549ba83b43dbe58ae9fd73e7d7a0c26f695b3
regex compilation issue with (?q) |
| User & Date: | serhiy.storchaka on 2026-10-11 11:00:11 |
Changes
- icomment:
As re_syntax(n) says, embedded options such as <code>(?q)</code> are available only at the start of an ARE. After <code>^</code>, <code>(?</code> is parsed as a group starting with a <code>?</code> quantifier, hence the error; PostgreSQL (same engine) rejects it the same way. <code>(?q)</code> also makes the rest of the RE literal, so it cannot be combined with <code>^</code>, and scoped forms like <code>(?q:...)</code> are not supported. For an anchored literal prefix use <code>string first $prefix $fn</code> == 0, or escape the prefix: <code><nowiki>regexp ^[regsub -all {\W} $prefix {\\&}] $fn</nowiki></code>. - login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"