Results 1 to 6 of 6

Thread: Javascript Wildcards

  1. #1
    Join Date
    Feb 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Javascript Wildcards

    Does javascript have a wildcard character such as * or % ? If so, how do you use it? If not, what alternatives are there to use?

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    If yo mean in terms of text manipulation, yep, via Regular Expressions. You may want to read up on Introductory Guide to regular expressions.

    p,s: I've shortened your sig, since the length of it made it easy to confuse it with your actual posts.

  3. #3
    Join Date
    Feb 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the link, i'll be sure to check it out!

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    A more extensive guide to regex can be found at http://www.regular-expressions.info/.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default JXtension 1.1 - Wildcard Expressions

    Last night, I put the finishing touches on a plugin for JXtension which allows you to use wildcards to search a string. It gives the user the capability to turn wildcard expressions into regular expressions. I know that many people have wondered if you could use wildcards in JavaScript, therefore I plan on adding this plugin to JXtension 1.1. On the other hand, if you don't think that it would be useful, perhaps I will leave it as a plugin. Since the goal of JXtension is to help the webmasters develop code faster, what do you think? Do you think that this would be a useful feature? Please reply here or take the poll and reply on my forum by clicking here.
    Last edited by bardonw; 12-02-2009 at 06:13 PM.

  6. #6
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post jPaq Allows Searching Strings with Wildcards

    Since jPaq has replaced JXtension, jPaq is the library that now gives you the ability to search strings with wildcard characters. Here are the three examples that are on the jPaq home page:
    Code:
    alert("Where in the world is Carmen Sandiego?".findPattern("C*n"));
    alert("Christopher West".replacePattern("(<*>) (<*>)", "p", "$2, $1"));
    alert("2 to the 64th is 18446744073709551616.".findPattern("#{3,}", "ol"));

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •