|
|
Browse by Tags
All Tags » .NET » dotNet
-
Dear colleagues,
I like to parse a text and split it at specific keywords (e.g. k1 or k2). I'll use it in a .NET application like
MatchCollection matches = Regex.Matches (sSrc, sRegEx); but for testing I am using RadSoftware Regex-Designer.
My sSrc is something like:
"k1 blakblak\r\nblakblak k2 blablabla k1 data3 k2 ...
-
OK. Stick with me here. It is going to take me a few to explain this.
I am writing a small application in VB.NET. The ultimate task is to make a web browser, within a web browser. Basically, You open IE, FireFox, Safari, or whatever browser you like and go to the web application I am building. At the top of the web page, I have a tool bar, ...
-
docdawson:
^(\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*){n,20}$
Doesn't this just match n to 20 e-mail addresses? I understand carlosaml wants addresses with no more than 20 characters.
The shortest possible address that will match the pattern above has 5 characters (a@b.c).
To check for 5 to 20 characters one would have to use a ...
-
This pattern might do what you need.
(?ms)(?<=^(TO|INFO)\s).*?(?=\s+^(?:INFO|GR)\s)
It will only work reliably if there are no two other lines starting with TO, INFO or GR in the message body, i.e. after the first GR.
It will return one or two matches, depending on the presence of the INFO part. You will have to split those ...
-
Balancing groups to the rescue! (I hope .NET 1.1 understands those. 2.0 does.)
(?xsi) # ignore whitespace for fancy comments, singleline, case insensitive
<div\salign=center> # opening tag (This is where you specify your search term)
(?>(?:(?!</?div).)*) # not a opening or closing div tag, ...
-
Here you go:
(?i)^\[[^\]]+\]\.\[[^\]]+\]\s+(?:LIKE|=|<|>|<>|<=|>=)\s+(?:'[^']*'|\d+)(?:\s+AND\s+\[[^\]]+\]\.\[[^\]]+\]\s+(?:LIKE|=|<|>|<>|<=|>=)\s+(?:'[^']*'|\d+))?\s*$
|
|
|