Menu

#13 Common Regexp Library

open-later
None
2
2005-08-08
2003-02-19
D.H.
No

Perl has
Regexp::Common

I haven't seen a javascript equivalent.

How about we add it as a subproject of the DynAPI
or just make it a part of DynAPI

Discussion

  • Raymond Irving

    Raymond Irving - 2003-02-19

    Logged In: YES
    user_id=696242

    You should be able to use var reg = /pattern/switch;

     
  • D.H.

    D.H. - 2003-02-28

    Logged In: YES
    user_id=264900

    xwisdom
    I know how RegexP's work in java ;)
    http://crazyinsomniac.perlmonk.org/javascript/outsidelinks.ht
    ml
    Regexp::Common has the most commonly used
    regular expressions done correctly
    (no half-working patterns)
    I just think we need such a thing for JavaScript
    (the link I gave above has fairly decent URI regexs)

     
  • - 2005-08-08
    • priority: 5 --> 2
    • assigned_to: nobody --> warp9pnt9
    • status: open --> open-later
     
  • - 2005-08-08

    Logged In: YES
    user_id=706287

    Hmm, well, this seems to be way out of scope for DynAPI.
    ;-) But, let's see, I look at the list, and it doesn't seem
    like too many. I'd basically just have to see if licenses
    are compatible and just lift the code. Or else just start
    with a general list and muddle my way through the regular
    expressions. This would yield half broken ones, I'm sure. ;-)

    But in case it's generally useful, I think we should
    consider this new feature after other more basic things have
    been taken care of, like to test and fix what exists, catch
    up on bugs, patches, etc., work on the documentation sub
    system, examples and so on.

    Well, to summarize their list, consider the following.

    * balanced parenthesis
    * various language comments
    * delimited strings
    * palindromes
    * lists
    * network addresses
    * numbers (integers and reals)
    * profanity
    * leading and trailing whitespace
    * zip codes
    * email addresses
    * HTML/XML tags
    * more numerical matchers
    * mail headers (including multiline ones)
    * more URLS
    * telephone numbers of various countries
    * currency (universal 3 letter format, Latin-1, currency names)
    * dates
    * binary formats (e.g. UUencoded, MIMEd)

    This is a very time consuming and non-trivial project just
    to create, nevermind to maintain. Might be better suited
    for a sub-project. If someone really can't wait, buy a few
    regular expression books. Also note, REs might also be
    called irregular expression ;-) , due to different flavors
    and syntaxes supported on various browsers. I do not know
    if any of them are now or ever will be fully POSIX or
    (better) Perl compatible. They're fairly clunky and
    rudimentary from what I remember, but perhaps they have
    improved. It's been some years now. ;-)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.