|
Should the - be enclosed in \\ like: \-\ ?
Michael Mogensen
|
|
|
|
|
the regex works fine in Expresso, and since Expresso uses .net regex engine, it should work fine, Maybe the problem is in an another part of you code?
01-01-1970 <- Validates
31-12-2099 <- Validates
31-12-2100 <- Doesn't validate
01-01-1969 <- Doesn't validate
|
|
|
|
|
Thanx' I'll check it out...
Michael Mogensen
|
|
|
|
|
{1} is entirely redundant. Anything without a specifier is required exactly once. Also, a character class with one element is just extra typing, so [1][9] should just be 19. The only obvious problem I see is the month section only gets 01, 02, 11, and 12. I would try this:
^([0-2][1-9]|3[0-1])-(0[1-9]|1[0-2])-(19[7-9][0-9]|20[0-9][0-9])$
|
|
|
|
|
Also this works:
private readonly string STR_DDMMYYYY_PATTERN = @"^([0][1-9]|[1-2][0-9]|[3][0-1])-([0][1-9]|[1][0-2])-([1][9][7-9][0-9]|[2][0][0-9][0-9])$";
I figured the {1} problem out also. Seems that the validator-site is OK with dealing with apparently redundant chars - but class Regex are not?
So now this is OK:
Regex regexpDDMMYYYY = new Regex(STR_DDMMYYYY_PATTERN);
bool bIsValid = regexpDDMMYYYY.IsMatch(tbGeneral.Text);
if (bIsValid)
{
...
etc.
I'll test the [1][9] replacement also.
Thanx' again.
Michael Mogensen
|
|
|
|
|
A while back, I wrote a blog entry[^] on a general purpose regular expression date validator that you might want to take a look at. The code should give you some ideas, especially as it can show you why regular expressions for dates aren't enough on their own.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi I am using backend sql server and fronend is c#.Net
i am passing connetionstring e.g. (conn="computer name/Sqlexpress")
i am getting error on slash(/) error is "unrecognized escape" please give me solution
|
|
|
|
|
Add the "@"-sign before the connectionstring, e.g.;
conn=@"computer name/Sqlexpress"
--edit--
and turn that backslash around;
conn=@"computer name\Sqlexpress;
Initial Catalog=myDataBase;
User Id=myUsername;
Password=myPassword;"
I are Troll
|
|
|
|
|
Hi guys,
I am writing a C# app with Visual studio 2008 professional and .NET 3.5 on an XP SP2 box
I build an MSI installer and install it on a target machine (XP or Vista, same problem)
The install specifies 'All users'
I can start the app from other accounts than the one who installed it, but if the password changes, I cannot start it anymore
(get a message saying 'XYZ encountered a problem and must close... Send a report to Microsoft)
Does someone have an idea of what I am doing wrong?
Thenks
Andre
|
|
|
|
|
Dear All Gurus!
I have created a windows service that runs perfect when i use installUtil.exe but produce following error when i try to make it like self install like thing.
Error 1053: The service did not respond to the start or control request in a timely fashion.
i read self install technique from this Windows Services Can Install Themselves article, the author of the article is bit busy and not responding to my messages please help me.
Khayyam Sikander
|
|
|
|
|
|
Dear Aman Bhullar,
this link is not working...
Khayyam
|
|
|
|
|
|
Thanks for help
I got the solution please follow this link
<a href="http://cavemansblog.wordpress.com/2008/06/19/installing-dotnet-windows-services-the-easiest-way/">http://cavemansblog.wordpress.com/2008/06/19/installing-dotnet-windows-services-the-easiest-way/</a>
Thanks
|
|
|
|
|
sir
pls help me
i want to change label or textbox text at runtime form on vb.net
thx
|
|
|
|
|
what is the problem in changing the text.
Just use the "Text" Property of control to get/set the Text
|
|
|
|
|
labelName.Text = "WHATEVER YOU WANT"
Humble Programmer
|
|
|
|
|
this problem is not resolved by me .plz help me in this problem.
private void hSLFilterToolStripMenuItem_Click_1(object sender, EventArgs e)
{
// create filter
SaturationCorrection filter =new SaturationCorrection(0.1);
// apply the filter
System.Drawing.Bitmap Image = filter.Apply(image);
}
a nullreferance exception is occured in applying the filter
hope for good reply
|
|
|
|
|
fizza bib wrote: System.Drawing.Bitmap Image = filter.Apply(image);
Where the image object is declared and Initialized
|
|
|
|
|
Thanks sir for your kind reply.
Image is placed in Form1's picturebox.
i am waiting for ur reply.
|
|
|
|
|
Thanks sir for your kind reply.
Image is placed in Form1's picturebox.
i am waiting for ur reply.
/////////best regards
Fizza Bibi
|
|
|
|
|
I am looking to lock my usb pen drive. It should ask for password when i try to open the file in the usb pen drive. Is there any way I can do this using vb.net or c#.
|
|
|
|
|
I do not know a programmatic way to do what you want. Someone else may come along who does, but in case not:
1) TrueCrypt has a tutorial here[^] on how to do it with their software, which I believe is free.
2) Zip the confidential data in a password protected *.zip file. There are several free Zip Libraries for .NET. (google)
3) Get a U3 enabled drive such as this[^] one which comes with security enabled. The link is a UK one, but it is the drive that you should look at.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
use the cryptography namespace to encrypt the file on the pen-drive?
|
|
|
|
|
There is no method to do with without writing an extension to NTFS, which you can't do in VB.NET or C#.
|
|
|
|