Skip to content Skip to sidebar Skip to footer
Showing posts with the label Regex

Javascript String.replace Fails At German Umlaute

I am using a small Javascript/Jquery function to inject a element into some text, if there is not … Read more Javascript String.replace Fails At German Umlaute

Regular Expression Match All Except First Occurence

I need a regular expression to match all occurrences of a dot (.) except the first one. For example… Read more Regular Expression Match All Except First Occurence

Remove All Spaces Before And After Parentheses

I would like to remove one or more spaces before and after any parentheses. Following this post whe… Read more Remove All Spaces Before And After Parentheses

Can't Get Regex Pattern To Work Correctly In Mvc 5 View Using Javascript

Here is my pattern. I'm trying to allow numbers and a decimal with two places plus an optional … Read more Can't Get Regex Pattern To Work Correctly In Mvc 5 View Using Javascript

How To Fix This Regex So It Replaces * Properly (between Words)?

I'm practicing regex. I thought of creating regex that turn * into , just like with Markdown: … Read more How To Fix This Regex So It Replaces * Properly (between Words)?

How To Replace "\" With "\\" From A String Using Javascript?

I tried mystring.replace(/\\/g,'\\') but that didn't work. Can someone advise me how t… Read more How To Replace "\" With "\\" From A String Using Javascript?

Regular Expression To Force Single Blank Space After A First Character

How do I force a space after first character as user types. I just need only one space after first … Read more Regular Expression To Force Single Blank Space After A First Character

Regexp Not Cutting Url Proprerly

I have the following code which is giving me a few headaches as all seems to work fine on paper, bu… Read more Regexp Not Cutting Url Proprerly

Javascript Regex Matching Is Ignoring Literal Dot

I'm trying to match all anchors on a page that link to files with certain extensions, but the c… Read more Javascript Regex Matching Is Ignoring Literal Dot

Regex Javascript To Match Both Rgb And Rgba

Currently I have this regex which matches to an RGB string. I need it enhanced so that it is robust… Read more Regex Javascript To Match Both Rgb And Rgba

Parsing Wiki Templates Calls With Javascript

All that I need is to split the wiki template call to parameter parts. In the very basic scenario i… Read more Parsing Wiki Templates Calls With Javascript

Is There A Way To Make Jslint Happy With This Regex?

When running my JavaScript through JSLint, I get the following two errors from the same line of cod… Read more Is There A Way To Make Jslint Happy With This Regex?

How To Replace At The Particular Range Of Indexes?

I have a string like this: var str = 'this is test1 this is test2 this is… Read more How To Replace At The Particular Range Of Indexes?

Reformatting Date String

Given input like 'Tue Aug 30 2011 11:47:14 GMT-0300', I would like output like 'MMM DD … Read more Reformatting Date String

Capitalize Hyphenated Names In Javascript

I need to capitalize names in javascript and so far I've found these methods on SO: // doesn… Read more Capitalize Hyphenated Names In Javascript

Regular Expression To Match At Least Two Special Characters In Any Order

I have to do jQuery form validation for password. The password should contain at least two special… Read more Regular Expression To Match At Least Two Special Characters In Any Order

Regular Expression With Asterisk Quantifier

This documentation states this about the asterisk quantifier: Matches the preceding character 0 or… Read more Regular Expression With Asterisk Quantifier

Javascript: Extract A Date From A String?

I have a string formatted as either Today 3:28AM Yesterday 3:28AM 08/22/2011 3:28AM What I need to… Read more Javascript: Extract A Date From A String?

Javascript Regex For Decimal

I need a regex for a 5 digit integer number with 2 decimals. These would be correct: 12345.12 0985… Read more Javascript Regex For Decimal

Regex Match Whole Word Including Whitespace And Fullstop

I am trying to build a regex that matches a word within and tags and replace the word with some o… Read more Regex Match Whole Word Including Whitespace And Fullstop