Regular Expression For Comma Delimited List
May 30, 2007
I cannot get anything to validate a comma delimited list of stock
symbols, like "IBM, MSFT,INTC). symbols are alphanumeric with a maxium
length of 5. I want to block multiple, adjacent commas, and allow up
to two blank spaces between symbols.
The following did not work:
(w{1,5}(, *)?)*
View 6 Replies
ADVERTISEMENT
Dec 7, 2006
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.
^([A-Za-z0-9]?)+([,]s?([A-Za-z0-9]?)+)*$
View 1 Replies
View Related
Aug 23, 2011
what is the regular expression for a comma-separated list (in this case - IPs) ?My list looks like this: 192.168.0.1, 10.%.23.100, %.46.%.1So far I managed to create this:^[0-9%]{1,3}.[0-9%]{1,3}.[0-9%]{1,3}.[0-9%]{1,3}$But I don't know how to specify a comma-separated list of the above sequence.
View 2 Replies
View Related
Feb 17, 2011
I have a gridview that displays client data. The first column on each row for the gridview is a checkbox. The second column on the gridview is client name and the third column is account holder. The user can select checkboxes (on multiple rows) to modify data (account holder).
I want to add clientName column value in a comma delimited string to a hiddenfield on my page. How do I do that using javascript, as I do not want to use postback and looping through each row on the grid to get the checkbox status. When a checkbox is checked, it should append the hiddenfield value.
I am getting the hiddenfield value as blank no matter what checkboxes are checked. I also know that my code is not targeting the correct row to get ClientName (row where checkbox is checked).
function RowClick(CheckBox)
{
var BaseControl = document.getElementById('<%= this.myGrid.ClientID %>');
var TargetControl = document.getElementById('MyHiddenField');
[Code]....
View 3 Replies
View Related
Feb 16, 2011
I have a asp.net gridview that displays client data. The first column on each row of the gridview is a checkbox. The second column on the gridview is client name and the third column is account holder. The user can select checkboxes (on multiple rows) to modify data (account holder).
I want to add clientName column value in a comma delimited string to a hiddenfield on my page.How do I do that using javascript, as I do not want to use postback and looping through each row on the grid to get the checkbox status. When a checkbox is checked, it should append the hiddenfield value.
I am a newb on javascript. Please review my javascript code and suggest corrections. I am getting the hiddenfield value as blank, no matter what checkboxes are checked. I also know that my code is not targeting the correct row to get ClientName (row where checkbox is checked).[code]...
View 2 Replies
View Related
Aug 12, 2009
I am stuck on this seemingly simple validation loop.I want to iterate through a list of comma separated emails entered in a textarea input and check their validity before submitting the form.For some reason even when I enter all valid emails every other email doesn't pass the validation test!
var okEmailArr = badEmailArr = new Array();
var emails = $('#emailList').val(); // Get email list from text are
input[code]....
View 1 Replies
View Related
Mar 29, 2010
I want to set opacity parameter value before calling: $('x').animate({opacity:1},v1);
of course, other than setting a switch case line for each possible expected value.
View 2 Replies
View Related
Feb 21, 2006
I have seen lot of reg. expession with ?:
For dummy eg
(((XXX)ddd)ff)
The above expression is modified as
(?:(?:(XXX)ddd)ff)
Although both the above expr. gives same result. (RegExp.match() gives
same o/p), most of the places , i have seen second option.
Yes, but different matches r shown (using RegExp.exec())
Is the second expr. most efficient or in particular scenarios?
Any comments???
View 5 Replies
View Related
Mar 17, 2009
I need to process a list of items and I can use the following code but I'm having an issue.
Using the .length, the ',' registers as an entry. I can do an if entry == ',' then next, but that seems a bit clunky.
Is there another JS function that I can use to get each entry in the list?
View 3 Replies
View Related
Jun 28, 2006
At the moment my code is like:
function telValid(inString) {
var regexp = /^[0-9 +()]+$/;
return (inString.match(regexp,''));
}
which is use to validate phone numbers (UK at the moment)
this works ok, but wont allow - (Dashes) which i need..
tried doing:
function telValid(inString) {
var regexp = /^[0-9 +-()]+$/;
return (inString.match(regexp,''));
}
View 2 Replies
View Related
Jan 20, 2007
I am finding it difficult to find a regular expression for following situation(replace)
a b c d = a,b,c d
a b c = a,b c
View 8 Replies
View Related
Feb 5, 2009
regular express to get the file name from a URL?
It has to be flexible in that the extension can be either 4, 5, or 6 chars (.php, .html, .shtml for example) and needs to cater for and whether querystring parameters exist too.
So, both
[URL]
and
[URL]
The regex should return newthread for both.
View 4 Replies
View Related
Nov 13, 2009
I.E.:
---------------------------
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?
<object width="500" height="200"><param name="movie" value="http://www.youtube.com/v/JTmM3jut05Q&hl=en&fs=1&"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/JTmM3jut05Q&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="200"></object>
how can i get "src" value in above code using regular expression?
View 6 Replies
View Related
Jul 7, 2010
what will be the regular expression for this line:
Code JavaScript:
var id = $(this).attr("href").substring( $(this).attr("href").lastIndexOf('#'), $(this).attr("href").length);
Basically it gets the string after # in href attribute of clicked anchor tag.
View 3 Replies
View Related
Aug 26, 2010
I have this expression:
/(19|20)dd/)[- /.](0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])
to detect if my date:
2010-12-15
is valid. It's not working. What do I have wrong?
View 6 Replies
View Related
Dec 30, 2004
When Internet Explorer 5.01 for Windows hits the regular expression:
/(?=<)|>/
it complains about an unexpected quantifier. In fact, it seems to complain whenever I use a lookahead expression. Is there any way around this?
View 2 Replies
View Related
Jul 23, 2005
does anyone know how I can build a regular expression e.g. for the
string.search() function on runtime, depending on the content of
variables? Should be something like this:
var strkey = "something";
var str = "Somethin like this";
if( str.search( / + strkey + / ) > -1 )
{
...
}
View 9 Replies
View Related
Oct 9, 2007
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.
View 2 Replies
View Related
Jul 20, 2005
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.
Going further, I want to generalize and use a JavaScript variable containing
the decision string, but first I need to worry about the not-within-a-line
problem.
View 26 Replies
View Related
Aug 7, 2009
I would like to validate a textbox that numbers cannot be entered into the text input, how do i do this??? With regular expression??
View 8 Replies
View Related
Oct 15, 2010
Does jQuery support a regular expression as a selector? eg: so I can get every element with a id beginning with "test"
View 2 Replies
View Related
Mar 19, 2008
I've got a somewhat cumbersome function that looks like this.
Code:
parseCSVLine = function (line)
{
var tmp = [];
var inQuote = false;
[Code]....
View 4 Replies
View Related
Apr 30, 2009
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.
View 7 Replies
View Related
Mar 31, 2009
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.
View 2 Replies
View Related
Sep 8, 2009
I would like to perform a regular expression on a string and if TRUE do something.
I have huge amounts of knowledge doing this in PHP but trying out javascript.
View 1 Replies
View Related
Jan 27, 2010
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.
function isValidFirstName(p1_firstName) {
//http://www.javascriptkit.com/jsref/regexp.shtml
var re = new RegExp("[A-Za-z]");
[code]....
View 6 Replies
View Related