|
Check this.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
Again, nope.
I'd already tried that one. The code sets up a pattern of [a-z], and then declares that if your string matches that, then AllCaps = True. How can that be?
So this:
<snip>
System.Text.RegularExpressions.Regex rgxTest = new System.Text.RegularExpressions.Regex("[a-z]");
MessageBox.Show(rgxTest.IsMatch("AAA").ToString());
Which uses the suggested pattern of [a-z] to match all caps, unsurprisingly returns False.
But then this returns True:
<snip>
System.Text.RegularExpressions.Regex rgxTest = new System.Text.RegularExpressions.Regex("[a-z]");
MessageBox.Show(rgxTest.IsMatch("AaA").ToString());
|
|
|
|
|
This time it is because you there actually is a match, namely "A"
edit: if you want the whole string to match you can use the ^ and $ anchors
|
|
|
|
|
Thanks Harold, that appears to be the missing link:
<snip>
System.Text.RegularExpressions.Regex rgxTest = new System.Text.RegularExpressions.Regex("^[A-Z]*$");
MessageBox.Show(rgxTest.IsMatch("ABC").ToString()); // True
MessageBox.Show(rgxTest.IsMatch("AbC").ToString()); // False
MessageBox.Show(rgxTest.IsMatch("abc").ToString()); // False
MessageBox.Show(rgxTest.IsMatch("ABC!").ToString()); // False
Which is the behaviour I was after.
Cheers!
Tok
|
|
|
|
|
Hi,
Try approaching this from another direction. You that want to detect if the input string contains any characters that aren't A-Z0-9.
The expression [^A-Z0-9]+ will match one or more characters not in the set A-Z0-9.
class App {
internal void Run() {
String[] tests = new String[] {"aAa!", "aardvark", "Aardvark", "AARDVARK",
"0123456789", "0123456789a"};
foreach (String s in tests) {
TestRegex(s);
}
}
private static void TestRegex(String test) {
String expr = "[^A-Z0-9]+";
Regex rgxTest = new Regex(expr);
Boolean result = !rgxTest.IsMatch(test);
Console.WriteLine("String {0}\nExpr {1}\nResult {2}\n", test, expr, result);
}
Alan.
|
|
|
|
|
Nice as well, thanks Alan.
I'm using this as a regex validation rule in the nettiers[^] framework, so I need to do the "matches" version, rather than the "exceptions" version you've presented ... but I'll definitely hold onto that snippet for future reference!
Tok
|
|
|
|
|
Hello,
I am building C# desktop application (client) that will connect to SQL Server on remote machine.
There will be many clients connecting to the database at the same time.
What do you advise me to do?
a) Schould every client connect directly to the remote SQL server?
b) Should I create some middle-tier between application and the SQL server, for example some webservice?
If yes, whats the best way to communicate between the middle tier and the client? SOAP?
I'm just new to .NET and I wonder what are drawbacks of either approach. The most important thing for me
is simplicity of the solution , I need to finish thins app as soon as possible.
Thanx 
|
|
|
|
|
For an internal app, I generally just connect to the database from the client.
|
|
|
|
|
is there any way to compare retrive record of a person according to his/her photo using c# and sqlserver database
image can be diffrent but will be of same person
means that if image is of same person we will able to fetch records
Plz give me any idea 
|
|
|
|
|
Take a look at this[^].
and
Image Recognition with Neural Networks[^], this one is from here on CP, although it is not strictly about facial recognition.
This is not an easy subject, so good luck.
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.”
|
|
|
|
|
Is it realy hard about face recognition ..... some time I tought to work on it for ma final project .... I think it needs some data mining cource???
|
|
|
|
|
I think it is, but then I'm not that good at Graphicsy type things.
There is a lot of work going on in the field, but finding easily understood articles on it is not so simple.
I'll probably get a handle on it eventually, I tend to absorb things like that over time, until the little light bulb comes on, then I'm OK.
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.”
|
|
|
|
|
|
monu_khan wrote: actually can i store image in database and compare them
but it does not work
Can you explain what 'it does not work' means?
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.”
|
|
|
|
|
Hey buddies ,..... i am working on C# Socket programming .... but i got a reference abt socket programmin in Java ............. and I got this word .... "THE JAVA MEDIA FRAMEWORK (JMF)" can any body tell me its equivalent in c#.....Thank you.
|
|
|
|
|
System.Net.Sockets namespace. Well, it's not really the equivalent but it is where sockets live.
Just google c# sockets, loads and loads of help.
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.”
|
|
|
|
|
OMG .... I am trying to work using System.Net.Sockets ... but I thought it will have another namespace ... So is that means the Java functios will have an equivalent in C# too ...Thank you budy ...........
|
|
|
|
|
The biggest problem in trying to use Java stuff/terms in .net and the other way round, is that they dont always have the same technologies grouped into the same libraries.
I can't think of an example off the top of my head, but you will almost certainly find some socket related things from the JMF that aren't in the System.Net.Sockets namespace. Conversely some things in the System.Net.Sockets namespace won't be in the JMF.
So in this instance when you find one of these problems, get your google-fu working.
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.”
|
|
|
|
|
|
Can someone point me in the right direction of how to create a bmp file that is 1 pixel by 1 pixel image>
|
|
|
|
|
Bitmap bitmap = new Bitmap(1, 1);
string fullPath = string.Format(
"{0}\\bitmap.bmp",
Environment.GetFolderPath(Environment.SpecialFolder.MyPictures));
bitmap.Save(fullPath);
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
modified on Friday, August 28, 2009 3:38 PM
|
|
|
|
|
Ha, see, if you'd have put the saving stuff in the first time, I might have beaten you to the punch.
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.”
|
|
|
|
|
I thought about it post posting when I reread the OP's post. Luc beat me once tonight, can't let it happen again!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
So you decided on cheating all the time, hoping to have a slightly better chance of being the first at it?
Next people will start and claim it is my fault the average reply quality is going down...
PS: if you want to compete, choose one of the competitions, lean-and-mean or otherwise. I suggest we don't turn the forums into battle fields.
|
|
|
|
|
I should have put a joke icon on that post Luc, I don't take it that seriously. If someone else answers a question that's great, so long as the OP gets the correct answer which this time he did - twice.
In this case I read the Subject 'Create a bmp' and read in the post '1 x 1' so went ahead and answered. I then reread the question (as I always do to make sure I have given the fullest answer I can) and noticed he wanted a bitmap file so I modified my post to show how to save it to a file. In the minute or so whilst I modified my post, Henry had posted his answer.
No cheating, no battle field - and all in good spirits trying to help the OP from me and Henry
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|