Word vs. RegExp
-
In what way do RegExps prevent you from searching for newlines? :confused:
Regards, Nish
Most recent article : Adding data-bindable attributes to C# enums using the dynamic runtime My technology blog: voidnish.wordpress.com
Multiple newlines. This is what I need to find.
-
Multiple newlines. This is what I need to find.
Bassam Abdul-Baki wrote:
Multiple newlines.
Just use \n or \r or both in your RegExp. That's all.
Regards, Nish
Most recent article : Adding data-bindable attributes to C# enums using the dynamic runtime My technology blog: voidnish.wordpress.com
-
Bassam Abdul-Baki wrote:
Multiple newlines.
Just use \n or \r or both in your RegExp. That's all.
Regards, Nish
Most recent article : Adding data-bindable attributes to C# enums using the dynamic runtime My technology blog: voidnish.wordpress.com
It's never worked for searching multiple lines of text.
-
It's never worked for searching multiple lines of text.
Bassam Abdul-Baki wrote:
It's never worked for searching multiple lines of text.
Never worked for you? Test this code out:
static void Main() { string text = @"Line 1
Line 2
This
is what
I need to
find.
Line 3
Line 4.";Regex regex = new Regex("This\\r\\nis what\\r\\nI need to\\r\\nfind.", RegexOptions.Multiline); Console.WriteLine(regex.IsMatch(text)); // outputs true as expected }
Regards, Nish
Most recent article : Adding data-bindable attributes to C# enums using the dynamic runtime My technology blog: voidnish.wordpress.com
-
Bassam Abdul-Baki wrote:
It's never worked for searching multiple lines of text.
Never worked for you? Test this code out:
static void Main() { string text = @"Line 1
Line 2
This
is what
I need to
find.
Line 3
Line 4.";Regex regex = new Regex("This\\r\\nis what\\r\\nI need to\\r\\nfind.", RegexOptions.Multiline); Console.WriteLine(regex.IsMatch(text)); // outputs true as expected }
Regards, Nish
Most recent article : Adding data-bindable attributes to C# enums using the dynamic runtime My technology blog: voidnish.wordpress.com
My bad. I never meant programmatically. I was talking about the free RegExp tools out there that I've seen. None of them allow me to search for multiline text.
-
My bad. I never meant programmatically. I was talking about the free RegExp tools out there that I've seen. None of them allow me to search for multiline text.
Bassam Abdul-Baki wrote:
My bad. I never meant programmatically. I was talking about the free RegExp tools out there that I've seen. None of them allow me to search for multiline text.
Ah okay. That's a tool limitation then. Not a RegExp issue :-) It's quite likely that Word internally uses RegExps anyway.
Regards, Nish
Most recent article : Adding data-bindable attributes to C# enums using the dynamic runtime My technology blog: voidnish.wordpress.com
-
My bad. I never meant programmatically. I was talking about the free RegExp tools out there that I've seen. None of them allow me to search for multiline text.
Pay the nominal license fee and get RegEx Buddy[^]. I use it all the time at home and at work. HTH
-
Bassam Abdul-Baki wrote:
My bad. I never meant programmatically. I was talking about the free RegExp tools out there that I've seen. None of them allow me to search for multiline text.
Ah okay. That's a tool limitation then. Not a RegExp issue :-) It's quite likely that Word internally uses RegExps anyway.
Regards, Nish
Most recent article : Adding data-bindable attributes to C# enums using the dynamic runtime My technology blog: voidnish.wordpress.com
Yeah, but most of these tools support the RegExp syntax, but not multilines. All of the free tools I've seen are great in almost every way, but this. Maybe I should start paying for stuff? :)
-
My bad. I never meant programmatically. I was talking about the free RegExp tools out there that I've seen. None of them allow me to search for multiline text.
Bassam Abdul-Baki wrote:
I was talking about the free
That's your first problem. IMHO, "most" FREE stuff is crap and if it isn't crap then it is very limited in what it does. I don't have time for many limitations...do you? :)
-
Pay the nominal license fee and get RegEx Buddy[^]. I use it all the time at home and at work. HTH
Slacker007 wrote:
Pay
What's that?
-
Bassam Abdul-Baki wrote:
I was talking about the free
That's your first problem. IMHO, "most" FREE stuff is crap and if it isn't crap then it is very limited in what it does. I don't have time for many limitations...do you? :)
My wallet and I disagree on many levels.
-
My bad. I never meant programmatically. I was talking about the free RegExp tools out there that I've seen. None of them allow me to search for multiline text.
Depending on what kind of regex tool you are looking for, have a look at these: Expresso[^] - helps you design, examine and test regexes. PsPad[^] - programmers editor which includes full Regex searching if you turn it on.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
-
My wallet and I disagree on many levels.
You can afford Microsoft Word and other more expensive software that you have at your disposal (I'm sure) but you can't shell out the 40 bucks for RegEx Buddy? Well, I can't help you there; that's your call. Just so you know, I'm not rich either but I'm not going to let 40 measly dollars stop me from getting the job done. Good luck to you. ;) [edit] You could try Expresso mentioned by OG below. It's free and it does search multiple lines but I don't know if it actually searches files on your computer based on your search criteria. I have used it before but it is not as powerful as RegEx Buddy. Again, my personal opinion.
-
My bad. I never meant programmatically. I was talking about the free RegExp tools out there that I've seen. None of them allow me to search for multiline text.
-
You can afford Microsoft Word and other more expensive software that you have at your disposal (I'm sure) but you can't shell out the 40 bucks for RegEx Buddy? Well, I can't help you there; that's your call. Just so you know, I'm not rich either but I'm not going to let 40 measly dollars stop me from getting the job done. Good luck to you. ;) [edit] You could try Expresso mentioned by OG below. It's free and it does search multiple lines but I don't know if it actually searches files on your computer based on your search criteria. I have used it before but it is not as powerful as RegEx Buddy. Again, my personal opinion.
I can afford forty bucks. However, if my company won't pay for it, I'm not going to buy it. It's the principle. :)
-
I can afford forty bucks. However, if my company won't pay for it, I'm not going to buy it. It's the principle. :)
My company wouldn't buy it for me either so I had to. I hear you about the principle. :)
-
Depending on what kind of regex tool you are looking for, have a look at these: Expresso[^] - helps you design, examine and test regexes. PsPad[^] - programmers editor which includes full Regex searching if you turn it on.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
I've used PsPad. Didn't see a way to search multiline and I didn't find a RegExp section in their Settings.
-
That's because the regex library used by ~99% of windows applications is a severely limited pile of garbage.
3x12=36 2x12=24 1x12=12 0x12=18
Great, so which 1% do you recommend?
-
I've used PsPad. Didn't see a way to search multiline and I didn't find a RegExp section in their Settings.
My mistake - multiline doesn't work in PsPad - I thought it did. Regex is enabled in the Search/Replace box by the checkbox labelled "Regular Expressions"
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
-
Yeah, but most of these tools support the RegExp syntax, but not multilines. All of the free tools I've seen are great in almost every way, but this. Maybe I should start paying for stuff? :)
Try Expresso[^] Free and awesome.
Semper Fi http://www.hq4thmarinescomm.com[^]
www.jaxcoder.com[^] WinHeist - Windows Electronic Inventory SysTem