Answer by MikeM for Regular Expression - Formatting text in a block - IM
I recommend that you remove the inner negative look-aheads from your negative look-aheads:/(?!(?!.*?<a)[^<]*<\/a>)_it_/.test( ' _it_ <a></a>' ); // true...
View ArticleAnswer by MikeM for Regular Expression - Formatting text in a block - IM
The following shouldn't create incorrectly nested spans var old;var rx = /(?![^<]*(?:>|<\/a>))([!*_-])((?!\1)[^<>\s][^<>]*?)\1/g;while ( old != str ) { old = str; str =...
View ArticleAnswer by talemyn for Regular Expression - Formatting text in a block - IM
Try these:var boldPattern = /\*([^\s][^\*]*)\*/gi;var italicsPattern = /_([^\s][^_]*)_/gi;var strikethroughPattern = /-([^\s][^-]*)-/gi;var underlinePattern = /!([^\s][^!]*)!/gi;Though, in the replace,...
View ArticleRegular Expression - Formatting text in a block - IM
Hello I am trying to figure out a regular expression to replace text in an innerHTML block to provide local formatting for text similar in operation to Google IM.Where:...
View Article
More Pages to Explore .....