|
Meta tags:
description=Implement UTS #18 RL1.3 set operations in regular expression character classes: difference [A--B], intersection [A&&B] and union [A B], with nested, complemented and compound operands and arbitrary left-to-right chaining ([a-z--[aeiou]&&\w]). Symmetric difference [A~~B] remains reserved (still a FutureWarning).
These tokens (--, &&, , and nested [) have been reserved since 3.7 via FutureWarning, so this turns the warnings into real syntax.
The feature is parser-only: each operation maps to an assertion on the matched character — [A--B] → A(? ![B]), [A&&B] → A(? =[B]), [A B] → a merged charset [AB] or an alternation — so no charset complement is ever formed and the result is correct under IGNORECASE. A leading ^ negates by De Morgan, pushing the negation into the operands. The engine and MAGIC are untouched.
A [ opens a nested set only immediately after a set operator; at the start of a class it stays an ordinary literal, so existing patterns such as [[:alpha:]] and glob s [*?[] keep their meaning.
The new syntax is also used in the standard library (_strptime, textwrap, doctest, pkgutil).
🤖 Generated with Claude Code
Issue: gh-152100;
Headings (most frequently used words):
uh, oh, navigation, gh, 152100, support, set, operations, in, character, classes, 152153, footer, diff, view, menu, repository, there, are, no, files, selected, for, viewing, filter, by, extension,
Text of the page (most frequently used words):
file (37), the (26), and (25), this (20), unicode (20), set (20), line (19), that (18), github (16), characters (16), hidden (15), for (15), #character (14), show (13), applied (12), diff (12), single (11), open (11), reload (10), expand (10), number (10), bidirectional (10), lib (10), support (10), change (9), changes (9), all (9), loading (9), rst (9), while (8), may (8), nested (8), regular (8), expressions (8), you (7), suggestion (7), cannot (7), suggestions (7), comments (7), code (7), contains (7), learn (7), about (7), view (7), got (7), 152100 (7), sets (7), sign (7), please (6), there (6), what (6), review (6), more (6), current_format (6), matches (6), operations (6), index (6), not (5), security (5), 2026 (5), commit (5), was (5), error (5), page (5), down (5), original (5), text (5), interpreted (5), compiled (5), differently (5), than (5), appears (5), below (5), editor (5), reveals (5), desktop (5), delete (5), edit (5), serhiy (5), storchaka (5), classes (5), doc (5), with (5), library (5), your (5), can (4), right (4), pull (4), from (4), retry (4), ascii (4), technical (4), standard (4), next (4), literal (4), operator (4), files (4), issue (4), copilot (4), community (3), navigation (3), request (3), add (3), batch (3), only (3), _strict_pattern (3), def (3), pkgutil (3), addition (3), deletion (3), want (3), self (3), doctest (3), _strptime (3), lowercase (3), example (3), aeiou (3), difference (3), whatsnew (3), will (3), exc (3), futurewarning (3), after (3), are (3), hide (3), whitespace (3), filter (3), commits (3), 152153 (3), merged (3), python (3), account (3), quality (3), another (3), tab (3), window (3), refresh (3), session (3), developers (3), changelog (3), customer (3), enterprise (3), grade (3), features (3), build (3), time (2), contact (2), status (2), privacy (2), terms (2), footer (2), now (2), existing (2), supported (2), one (2), viewing (2), toggle (2), oops (2), something (2), went (2), wrong (2), none (2), strict (2), dotted_words (2), 443 (2), sub (2), spaces (2), 1768 (2), new (2), re_sub (2), digits (2), 238 (2), contributed (2), consonant (2), written (2), square (2), brackets (2), intersection (2), union (2), operand (2), https (2), org (2), reports (2), tr18 (2), 168 (2), additions (2), deletions (2), added (2), operators (2), versionchanged (2), future (2), raised (2), escape (2), have (2), left (2), both (2), but (2), bracket (2), 279 (2), selected (2), set0ps (2), misc (2), news (2), textwrap (2), test_re (2), test (2), _parser (2), apply (2), split (2), unified (2), failed (2), load (2), jump (2), nbsp (2), extension (2), jun (2), tree (2), insights (2), projects (2), actions (2), repository (2), cpython (2), signed (2), universe (2), training (2), integrations (2), stories (2), center (2), documentation (2), business (2), fixes (2), products (2), secret (2), perform, action, share, personal, information, manage, cookies, docs, inc, check, back, later, queued, merge, multi, pending, reviews, has, been, marked, resolved, outdated, must, order, create, valid, applying, deleted, lines, per, subset, closed, invalid, because, were, made, annotations, notes, compile, global, _lenient_pattern, within, imported, package, get, desired, object, resolve_name, name, false, return, true, then, remove, check_output, optionflags, old, replacement_pairs, lambda, chr, 0x0660, int, isascii, lc_alt_digits, transform, non, range, 0660, 0669, replace, __calc_date_time, shlex, where, described, mod, supports, maurycy, pawłowski, wieroński, 149464, vertical, bar, semantically, constructs, still, raises, symmetric, yet, note, _unicode, include, ordinary, patterns, keep, their, meaning, anywhere, else, including, start, begins, immediately, leading, complements, whole, result, group, write, precedence, allows, combining, same, listing, members, letter, two, combined, contain, avoid, warning, them, backslash, sequences, includes, starting, containing, ambiguous, cases, being, syntax, facilitate, might, would, parentheses, match, well, braces, special, conversations, clear, filters, viewed, types, f9a4807, select, changed, checks, conversation, into, ops, stage1, main, already, clicking, agree, our, occasionally, send, related, emails, statement, service, free, its, maintainers, question, project, items, requests, issues, message, dismiss, alert, switched, accounts, out, appearance, settings, search, pricing, event, talks, workshops, partners, company, forum, events, webinars, blog, resource, connect, resources, premium, advanced, ons, trust, why, evaluate, see, industries, government, manufacturing, financial, services, healthcare, industry, nonprofits, startups, team, enterprises, stage, businesses, source, latest, improvements, across, place, developer, articles, sponsors, trending, repos, explore, customize, certifications, scanning, leak, prevention, protection, vulnerability, detection, remediation, secure, cloud, development, environments, codespaces, analysis, enforcement, automation, ship, coding, agent, tasks, automated, work, hosting, collaboration, platform, menu, skip, content,
|