November 18th, 2011, 04:09 PM
I have tried all your attempts at the expression I need.
Both your expressions produce different results.
only highlights hum and your in the first sentence... which is fine... even though I said I needed it to highlight all instance of hum and your/you
It highlights you hum a confident lullaby in the second sentence... again missing the first You.
The expression captures NOTHING in the last sentence...
How might you think it works? Maybe I'm just not seeing it.
matches only hum your song in the first sentence and in the second sentence only matchs You you hum and nothing in the third sentence.
The first you in the second sentence is only matched because it is a run on from the first sentence. So if the second sentence was the only thing to be matched.... it wouldn't find the first You.
The expression I said I made... works fine... except for the issue I mentioned in or just after that post...
November 18th, 2011, 04:32 PM
Kindly point out where you said that.
Originally Posted by krptodr
Originally Posted by krptodr
I'm going to say this as clearly as I can:
Write a full paragraph with at least 3 sentences and 100 words describing exactly (a1) what example input strings you have, both valid and invalid, (a2) which of those strings should match, should not match, and why (b) how you will be applying the regular expression to them, (c) what you are using to apply the regular expression, (d) the language you are using, (e) the expected matches, and (f) the expected behavior given those matches.
You have done some of A and D. Great. Please do the rest.
November 18th, 2011, 04:57 PM
I guess im just not understanding RegEx. I thought that anything that matches was only highlighted...
The reason the last line wasn't highlighted was because of the casing... again..
I do apologize if my last post seemed a bit nasty.
I'll re-examine everything with my new understanding and post back with any findings.
November 18th, 2011, 05:07 PM
The third sentence is completely highlighted because the "you hum" was at the beginning and, in that situation, you wanted the last two words. Thus the entire sentence gets matched.
November 21st, 2011, 03:31 PM
Ok, so the expression works, but I realized other possibilities that I need to match for. I'll work on those... but in the mean time.. the program that is using my regex is removing my tags that say to ignore casing...
How can the expression be used to and work and not have to worry about casing?
November 21st, 2011, 04:12 PM
You tell .NET to ignore case with RegexOption(s?).IgnoreCase.
November 21st, 2011, 04:20 PM
But im not the person who developed the program, that I am using the regex expression in. So the only way to get around it is to have the expression be designed to not care about the casing.
Originally Posted by requinix
November 21st, 2011, 05:00 PM
Well that sucks.
Every letter gets replaced with a [UPPERlower].