Validating selector

a regular expression adventure

Syd Bauman

Senior XML Programmer/Analyst
Northeastern University Digital Scholarship Group

Abstract

I needed a way to validate that the value of tei:rendition/@selector was a proper CSS3 selector. So I wrote a regular expression to do so. An 18,385-character-long regular expression. And it seems to work.


Table of Contents

Introduction
Against all odds
Writing the Regexp
Generating the generator
Case
Language
What the generator generated
RELAX NG schema
XSLT schema
Rapid cyclic debugging
Practical
Logical
Resources
Time
Memory
Storage
Future work
Availability
Bibliography