W3C home > Mailing lists > Public > public-qt-comments@w3.org > August 2003

[F/O] backreferences in regexen

From: Tobias Reif <tobiasreif@pinkjuice.com>
Date: Tue, 19 Aug 2003 10:10:17 +0200
Message-ID: <3F41DB69.3010808@pinkjuice.com>
To: public-qt-comments@w3.org


I'd like to re-raise a request I expressed in May [post1] regarding the 
addition of backreferences in regexen. It has been discussed previously 
so I expect no replies, but merely wanted it to be known that I still 
think that XSLT 2 / XQuery 1.0 / XPath 2.0 F/O should have this feature.

My research in May [langs] did show that the feature is widely available 
in programming languages and in existing regular expression libraries.
Among the popular languages which support backreferences in regexen  are 
Ruby, Perl, Python and Java, an ancient version of sed already supported 
this feature [sed], and the PCRE lib provides this feature for C++ etc 
so it can be used to implement regexen in many languages and apps.

F/O adds "^" and "$" to the regex set of WXS [additions] which are very 
useful, it should also add "\[number]".

Some developers (if not most) agree with me about the usefulness of the 

"I agree this can be a handy feature [...]"

... and some also agree that it is very popular in addition to being 
very useful:

"I agree with all of his arguments - back references are easy to 
implement, are available in every regex library I have used over the 
past several years, and extremely useful. Some tasks become 
substantially more difficult without back references.
I believe many real-world users will be unpleasantly surprised if back 
references are not supported."


(more sample output is at



"The regular expression syntax and semantics for these functions are 
identical to those defined in [XML Schema Part 2: Datatypes] with the 
following additions:
Two meta-characters, ^ and $ are added. In string mode, the 
metacharacter ^ matches the start of the entire string, while $ matches 
the end of the entire string.



Received on Tuesday, 19 August 2003 04:11:54 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:13 UTC