Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
L
libxml2
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 69
    • Issues 69
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 9
    • Merge Requests 9
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • libxml2
  • Issues
  • #57

Closed
Open
Opened May 09, 2019 by mtx500@mtx500

Regular expression with an empty branch at the end is not considered valid

The pattern "(([a-zA-Z0-9_]+)(;[a-zA-Z0-9_]+))|" is not considered valid. See attached small example libxml2_pattern_bug.zip. The regular expression language of XML Schema is defined as (see https://www.w3.org/TR/xmlschema-2/#dt-regex): regExp ::= branch ( '|' branch )* branch ::= piece* As "branch" may be empty, I see no reason why a pattern can't end with "|". Also, Altova XMLSpy, .NET XML Parser and Apache Xerces XML parser consider this valid. After moving the "|" to the front, the pattern is considered valid, but an empty string is still not accepted. After rewriting the pattern as "([0-9a-zA-Z_]+;)([0-9a-zA-Z_]+)?", the validation worked. (But it's not exactly the same check; it now accepts strings that end with ";".)

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/libxml2#57