W3C home > Mailing lists > Public > public-qt-comments@w3.org > November 2006

[Bug 3949] New regex function to match and return a list of captured strings

From: <bugzilla@wiggum.w3.org>
Date: Fri, 03 Nov 2006 23:12:16 +0000
To: public-qt-comments@w3.org
Message-Id: <E1Gg8Cu-0002QB-5u@wiggum.w3.org>


           Summary: New regex function to match and return a list of
                    captured strings
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Functions and Operators
        AssignedTo: ashok.malhotra@oracle.com
        ReportedBy: rslite@rdslink.ro
         QAContact: public-qt-comments@w3.org

I am working on a project using XSLT 2.0, XQuery 1.0 and XPath 2.0. The project
involves some heavy use of regex and I really miss a feature. I would like to
be able to do match betweem a regex and a string and get back a list of
captured strings. 
For example I should be able to do a regex-match('2006 Location',
'(\d{4})\s+(.*)') and I would get back a list of matches ('2006', 'Location').
The closest existent matching function is replace, but it gives some problems
when it doesn't match the string. Instead of returning an empty string I get
the original string which forces me to do an extra check.
Received on Friday, 3 November 2006 23:12:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:16 UTC