Plugins

The plugins site is currently in development.

We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.

regex


Match elements via REGEXP

This plugin and core extension allows you to match elements via REGEXP, both via a pseudo-selector and via a method, i.e.

See http://www.mitya.co.uk/scripts/Match-elements-via-REGEXP-jQuery-119 for download, demo and full details.

$('p:regexp(/\\d+/)');

or

$('p').regexp(/\d_/)

Note that, if you use the pseudo technique, you'll need to double escape any characters that need escaping.

jQuery fasterTrim

A faster version of jQuery.trim() (in versions of jQuery previous to 1.4.3) for those who need to trim a lot of strings, completely overkill for most people. It will use the native String.trim (if available) and will account for NBSPs not getting matched with \s in the regex for Internet Explorer and older versions of Safari. It also provides a function for trimming Unicode whitespace characters that might not be matched by \s or a native trim.


// this now uses the faster trim function
$.trim( " string " );
$.trimLeft( " string " ); // === "string "
$.trimRight( " string " ); // === " string"

// this uses the Levithan trim function, better for larger strings
$.levithanTrim( " string " );

// trim all whitespace including unicode characters
$.unicodeTrim( " \u3000 unicode string \u3000 " );

// OR:

// returns jQuery object with HTML trimmed
$( element ).trimHtml();

// returns jQuery object with text trimmed

Fvalidate

A web2.0 html form validation plugin.
Features:

  • - Set validation rules for any form field using inline rules (html attributes).
  • - Ability to use custom regex rules.
  • - Compare two fields for same value (e.g. email or password confirmation).
  • - Use API to take the power in your hands.
  • - Input class changes on error (Better UI).
  • - Disable alerts if you want.

highlightRegex

Want to highlight some text on a page in jQuery, maybe based on some dynamic input? Check out the highlight v3 by Johann Burkard. Need to be able to do the same thing but with a regular expression? You’re at the right place.

Demonstration

Check out a simple demo here.

Source

Download, fork, comment, etc on github.

Usage

At this point, it’s very simple:

$('#any.jquery.selector').highlightRegex(/[aeiou]/ig);

This would wrap all all vowels inside of #any.jquery.selector with a <span class='highlight'>.

To clear the highlighting, just call $('#any.jquery.selector').highlightRegex(); (with no argument).

jVal - attractive form field validation plugin with keypress validation

Super-sexy animated form field validation plugin.

Very easy to apply field validation on a per field basis in the html <INPUT> declaration. Very user friendly in showing each field that has not passed validation. Easy support for restriction of characters in a field, i.e. phone number only allowing digits. Allows for associating the ENTER key with a specific function.