Open Source project needs quick help from regexp expert: XML Namevalidation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • manos

    Open Source project needs quick help from regexp expert: XML Namevalidation

    Hello,

    I'm working on an open source JS version [1] of WAX (Writing API for
    XML). Most unit tests work [2] , but I need a regexp that validates
    strings are proper XML names [3]. I suck at regexps :-/

    If the regexp only matches the latin subset of unicode characters
    (i.e. english only), it would be OK for now.

    [1] http://dev.abiss.gr/wax.js/
    [2] http://dev.abiss.gr/wax.js/test/testwax.html
    [3] http://www.w3.org/TR/REC-xml/#NT-Name

    Thanks,

    Manos
  • Thomas 'PointedEars' Lahn

    #2
    Re: Open Source project needs quick help from regexp expert: XMLName validation

    manos wrote:
    I'm working on an open source JS version [1] of WAX (Writing API for
    XML). Most unit tests work [2] , but I need a regexp that validates
    strings are proper XML names [3]. I suck at regexps :-/
    Change that, then:

    <http://oreilly.com/catalog/regex/chapter/ch04.html>
    <http://developer.mozil la.org/En/Core_JavaScript _1.5_Reference: Global_Objects: RegExp>
    Doesn't the ABNF already provide the approach?


    PointedEars
    --
    var bugRiddenCrashP ronePieceOfJunk = (
    navigator.userA gent.indexOf('M SIE 5') != -1
    && navigator.userA gent.indexOf('M ac') != -1
    ) // Plone, register_functi on.js:16

    Comment

    Working...