I am creating a regular expression for a URL where the domain name (i.e. .com|.edu etc) is optional. That is both http://xyz and http://xyz.com should be valid. If <.> is present then com|edu|.. will be there; but if <.> is absent then com|edu|.. will not be there. Also there can be any number of <.>, but every <.> will be followed by characters. So in other words the string can't end with <.>, it should only end with [a-zA-Z0-9]. So far I have created the following part -
var regEx = new RegExp(str);
--------------------------- Windows Internet Explorer --------------------------- <EMBED src=http://www.youtube.com/v/JTmM3jut05Q&hl=en&fs=1& width=500 height=200 type=application/x-shockwave-flash allowfullscreen="true" allowscriptaccess="always"></EMBED>
how can i get "src" value in above code using regular expression?
I need a regular expression that will validate a double quote comma delimited list where the odd entries are numeric and the even are alphabetical. Each pair must also be on a separate line. For example:
"1","Peter" "2","Paul" "3","Mary"
I've used the following expression to validate comma delimited lists, but without the double quotes, numeric/alpha pairing and line return restriction.
Normally I can write regular expressions decently well but for some reason I am having trouble getting this to work. I am validating form data and need to throw an error if there are ANY spaces in the field. abc123 is fine, abc 123 is not. Any character is fine, just not a space.
All I'm trying to do is delete the lines which don't contain a particular string. Actually a filter to edit a log file. I can find and replace a thing with null, but can't figure out how to find the lines which do not contain the thing.
Here is the form in question: spraytechDOTcom/download_form.asp I am so close to getting this to work the way that I want, but here is what I am having an issue with: I cannot seem to make it look for the 12 digits that are in the phone numbers that we are going to collect. Ex. 800-123-4567
It doesn't have require 12 characters if there is another way to get the number to validate looking like the example above. Here is my regular expression that I am struggling with:
var re = /[^d-]$/ It seems to block any letters, but it will accept only 1 number. I would really like it to make sure that the phone number is only entered like this: 800-123-4567.
I have looked for days trying to figure this out and have only gotten close.
I'm trying to validate data in a textbox for township (usually written as 12N or 23S for Township 12 North or Township 23 South). In Utah the townships range from 01N to 15N, and 01S to 44S. The expression "/[0-9][0-4][ns]/i" will allow 01n (or s) through 94n (or s). If I change it to "/[0-4][0-4][ns]/i" to limit it to 44n (or s), I then am not allowing for 05, 06, 07, 08, and 09. I hope the above is not too confusing. I'm just starting to work with regular expressions.
This is my first serious attempt at using a regular expression.My first name field should allow alpha characters only [A-Za-z], but it seems to be testing for the presence of 1 alpha character. If one is found in the string then anything else is allowed.Bob returns valid which is what I need.Bob1 returns valid but should NOT be valid..1 returns valid not valid which is what I need.My code.
I'm looking for a regular expression that will match everything in this string before 546 so that I can replace it with an empty string and just be left with 546. The string could be of any length and contain any number of hyphens.
The mounds of RegExp data will take me days to sift through can someone help me create a regular expression to find a file extension? (all characters after a period) I have already gotten this far: .+. to find everything before and including the period; and I was hoping to integrate the caret to say everything but .+. But I just can't get it to work.
Note: I will be writing a file to the server with JScript ASP. The file name will be passed to the script that writes the file, and I want to make sure that in addition to removing any possible code from the line being written, that I also prevent an executable file from being created. I will be searching for certain extensions and returning if anything else is found.
I have a string like this "d2-23-543-56". It could be of any length, have any number of hyphens and will always end with an integer. I'm trying to come up with a regular expression that will match everything up to and including the last hyphen so that I can replace it with an empty string and have only the 56 left over, or whatever integer happens to be at the end of the string
I have a regular expression that looks like this: mytext = mytext.replace(/(*)([^)]+)/gi,"$1 <a href='http://www.mysite.com/script?Argument=$2'>$2</a>"); I understand that this takes text between a ( and ) and puts it into the variable. My question is: How can I change this to take text between a [[ and ]] and put that into the same variable?