jPaq Example - Wildcard Expression Tester

Many people know how to write wildcard searches (or wildcard expressions), but a lot less people know how to write regular expressions.  If you are this way, perhaps using the findPattern(strPattern, strOptions) function would be useful.  An example of how to use this is illustrated in the following form.


Wildcard Options:




NOTE:  The above content was taken from this Wikipedia article.


The initial wildcard expression basically matches a substring that starts at the beginning of a word with a capital "J" and ends at the end of a word with a lowercase "t".  Though this may sound simple, the regular expression for this is a bit complex, as you can see.  In order to run the wildcard expression against "Random Text", you can click the "Execute the Code" button.

Feel free to change the wildcard expression to what you would like to try out.  Ă…fter you modify the wildcard expression and move out of that field, the regular expression will be updated.  You may also change the "Random Text" to thoroughly test the wildcard string.  Lastly, as is normal on jPaq.org, you can modify the code section to test out your own code.

Applicable Parts

Related Examples

  1. Finding & Replacing with Wildcards
    The following shows you how to search strings by using wildcards and even how to replace what you find: alert("Where in the world is…
  2. Currying
    At times, you may want to call a function a number of times, but you may notice that the first few arguments are always the…