-
ASP.net and regular expression
Ok this probably has a really simple answer but i am new to asp.net and for some reason i just cant figure it out.
I have a text field that currently has a validator on it which has a regular expression attached to it.
my regular expression is as follows ^[a-zA-Z\d\s,.?!'@]+$ now i want to edit this so it can accept double quotes however as the reg ex is stored in a string ("^[a-zA-Z\d\s,.?!'@]+$") when i add the double quote into the reg ex it ends the string, i have tried escaping it with \ which doesn't work, is there a different escape character for asp.net? or am i just being stupid and missing something really obvious?
any help is welcomed
Thanks
-
Assuming you're using VB (in C#, escaping with \ should work), you can do this:
Pattern = "^[a-zA-Z\d\s,.?!'@" & Chr(34) & "]+$"
Or you can do this:
Pattern = "^[a-zA-Z\d\s,.?!'@\x22]+$"
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
-
Thread is accessible again now
I am using c# and the \ does not seem to work i have also tried it as its own escape char no no avail any other advice?
Last edited by -zorro-; 07-13-2007 at 07:19 PM.
-
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
-
Thanks for your help that seems to work
Similar Threads
-
By elmasduro in forum Database
Replies: 0
Last Post: 03-29-2007, 02:49 PM
-
Replies: 0
Last Post: 07-19-2006, 04:42 PM
-
Replies: 1
Last Post: 11-18-2005, 11:26 AM
-
By sunilbenjamin in forum ASP.NET
Replies: 2
Last Post: 09-29-2005, 02:09 AM
-
By Claudiu in forum Database
Replies: 1
Last Post: 02-05-2003, 08:50 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|