Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RegEx 1

Status
Not open for further replies.

TheConeHead

Programmer
Joined
Aug 14, 2002
Messages
2,106
Location
US
Can anyopne give me a reg expr see if a string has ", " in it? (not including the "'s

[conehead]
 
this should do the trick >>

Code:
var re = /\,\s/g;

alert( re.test("cory, cara") );
alert( re.test("cory,cara") );
alert( re.test("cory cara") );



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Hmmm I tried: (doing it in .net)

ValidationExpression="/\,\s/g"

And it does not validate anything - any ideas?

I want the textbox to have string, string

[conehead]
 
Where did you see quotation marks in the original example?

Lee
 
i'm not sure how .net handles regular expressions. it might be the \s that it doesn't recognize, or possibly the g (global). i suggest asking in the .net forum.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Client side Javascript is the same in ASP.NET pages as in any other web page. I don't thinkk JScript.NET is all that different in aspx pages, either. If TheConeHead isn't using Javascript or JScript, then he needs to ask the question in the appropriate forum, as Cory stated.

Lee
 
sorry - thought it would be the same....

[conehead]
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top