Re: Regex help
Hello Stuart, On Tuesday, April 29, 2014, 2:50:22 PM, Stuart wrote: I am looking for help with regex. I need to export the text from an e-mail to a text file. When I receive the email it looks like this. asd, sdf, dfg, asd Unfortunately when I export this is ends up like this. asd, sdf, dfg, asd This seems to be the way the program sending the file represents it. What is in the whitespace between the groups of characters in the original email? Tabs or spaces? It looks like tabs being expanded so perhaps the export process is turning tabs into spaces? How are you exporting the email? Save As? -- Julian Using The Bat! v6.4.0.2 on Windows 7 6.1 Build 7600 Current version is 6.1.8 | 'Using TBUDL' information: http://www.silverstones.com/thebat/TBUDLInfo.html
Re: Regex help
Hello jb, Tuesday, April 29, 2014, 10:25:49 AM, you wrote: What is in the whitespace between the groups of characters in the original email? Tabs or spaces? It looks like tabs being expanded so perhaps the export process is turning tabs into spaces? The original e-mail shows up with spaces, but if you look at the message source it looks like this: (except there are 11 spaces between each row. asd, sdf, dfg, asd How are you exporting the email? Save As? I am using a filter. It exports the text to a text file on the desktop. I was hoping that the regex could be used in the format message part. -- Best regards, Stuartmailto:skcu...@fastmail.fm Current version is 6.1.8 | 'Using TBUDL' information: http://www.silverstones.com/thebat/TBUDLInfo.html
Re: RegEx Help
Hallo Eddie, On Mon, 30 Apr 2007 20:40:01 +0100GMT (30-4-2007, 21:40 +0200, where I live), you wrote: EC Is this feasible? If yes can anyone give a help for this solution? EC Many thanks. You cannot let a QT search for a message somewhere in your message base. -- Groetjes, Roelof Hollywood: A trip through a sewer in a glass bottom boat. http://www.voormijalleen.nl/ The Bat! 3.99.3 Windows XP 5.1 Build 2600 Service Pack 2 2 pop3 accounts OTFE enabled P4 3GHz 2 GB RAM pgpYsg6XbPPBI.pgp Description: PGP signature Current version is 3.99 | 'Using TBUDL' information: http://www.silverstones.com/thebat/TBUDLInfo.html
Re: RegEx Help
Dear Roelof, -- Montag, 30. April 2007, 18:45:10: EC Is this feasible? If yes can anyone give a help for this EC solution? Many thanks. You cannot let a QT search for a message somewhere in your message base. Thanks. Any chance in simplifying my task? -- liebe GrĂ¼sse www.EddieCastelli.com Eddie :ec: on Tour Current version is 3.99 | 'Using TBUDL' information: http://www.silverstones.com/thebat/TBUDLInfo.html
Re: Regex help-hilfe-ajuto needed
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sat, 17 Aug 2002, at 18:25:20 -0700 Januk wrote in [EMAIL PROTECTED]">mid:[EMAIL PROTECTED] : JA On Saturday, August 17, 2002 at 21:35 GMT +0200, a stampede was JA started when Mandara hollered: Well, that's something... ;-) JA I know this should really go on TBTECH, but I suppose one or two of JA these every couple of years on TBUDL isn't so bad. . Januk, thanks a lot for the all useful things you wrote. I'll proceed with it on tbtech, as you and Luc suggested. Mandara - -- (__) If you need this key: ('') mailto:[EMAIL PROTECTED]?subject=0x257DFF36 \/ -BEGIN PGP SIGNATURE- iD8DBQE9X7lsvgcu6yV9/zYRAhHEAJ9HcfE2Coe2iv9+Rc7zw4K1eB7ObACgt9qM /GFqvgoH+cnSuEHxVaVXrbA= =P1cy -END PGP SIGNATURE- Current version is 1.61 | Using TBUDL information: http://www.silverstones.com/thebat/TBUDLInfo.html
Re: Regex help-hilfe-ajuto needed
Hello Mandara, On Saturday, August 17, 2002 at 9:35:24 PM you [M] wrote (at least in part): M Is there some elegant formula which would take only one line you M chose by the first word in the line? You nearly got it: ^From:\s*(.*?)\n You see the difference? The question mark is _inside_ the parentheses and it searches for the 'newline' explicitly. This should work quite fine and have everything after 'From:' followed by any number of white spaces but before 'new line' in sub pattern 1. -- Regards Peter Palmreuther (The Bat! v1.61 on Windows 2000 5.0 Build 2195 Service Pack 1) Borrow money from pessimists--they don't expect it back. Current version is 1.61 | Using TBUDL information: http://www.silverstones.com/thebat/TBUDLInfo.html
Re: Regex help-hilfe-ajuto needed
Hello Mandara, On Saturday, August 17, 2002 at 21:35 GMT +0200, a stampede was started when Mandara hollered: I know this should really go on TBTECH, but I suppose one or two of these every couple of years on TBUDL isn't so bad. This one ^From: (.*)?$ extracts to much and doesn't stop at the end of line (includes entire header from the from line downward). As Peter mentioned, you need to put the question mark inside the brackets. The reason is that the way you've written it, the expression says: Look for zero or one occurrence of any number of any character after a a line starting with From: . This means you have a redundancy in your repetition operators. What you wanted instead is: Look for the fewest number of anything on one line that starts with From: . To do that you need to make the any number operator (*) ungreedy. That is done by adding a question mark *immediately* after the repeat operator. So, .* matches the most number of any characters it can, while .*? matches the fewest number of any characters that it can. So a corrected version of your expression would be: ^From: (.*?)$ Of course, there are three stylistic things that I would change about the above. First, I usually add the ignore case option, just to be more general. Second, I usually use \s* instead of a literal space to find whitespace. This makes sure that I trim *all* spaces if there is more than one space and it removes other white space characters like tabs. Note, these suggestions make the expression more general, so there can be some undesired behaviour. In my experience, the undesired cases for these two suggestions are so rare that they are well worth the risk. The third suggestion is to explicitly set the multi-line mode. This prevents problems if the default settings ever get changed for any reason. It also makes it very clear what behaviour you want from TB. After all, the help file suggests that you actually are in the *opposite* mode by default, so your expression (and Peter's) would fail if From: wasn't the very first header. So the final corrected version that I would use would be: (?im-s)^From:\s*(.*?)$ Note I also unset the Dot All option. I'll let you read the help file (or the tutorial) to find out why. Be patient with me, please, I am very beginner, and already infected with regexp (last night downloaded Gerd's tutorial and forgot to go to sleep). I highly recommend that you subscribe to the TBTECH list. That list was specially designed for detailed technical discussions. It has become more or less specialized towards regexps. While Gerd's tutorial is very well written, it won't really sink in until you try analyzing some of the many expressions written on these lists. You should try it, post your results on TBTECH and you'll get some good feedback. -- Thanks for writing, Januk Aggarwal Ok, who is General Relativity, and what did he do with Sir Newton? Current version is 1.61 | Using TBUDL information: http://www.silverstones.com/thebat/TBUDLInfo.html
Re: Regex help-hilfe-ajuto needed
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sat, 17 Aug 2002, at 22:01:02 +0200 Peter wrote: PP ^From:\s*(.*?)\n PP You see the difference? The question mark is _inside_ the parentheses PP and it searches for the 'newline' explicitly. Yep, I got it. I glued myself with $ as only metachar for the end of the line. ;-) PP This should work quite fine and have everything after 'From:' followed PP by any number of white spaces but before 'new line' in sub pattern 1. Works like baby. Thanks! Mandara - -- (__) If you need this key: ('') mailto:[EMAIL PROTECTED]?subject=0x257DFF36 \/ -BEGIN PGP SIGNATURE- iD8DBQE9Xvo9vgcu6yV9/zYRAudYAJ9PVtEWzdTskGnc95hHuYovfy9OKQCePJ24 tbwahriRb9bFsBKZv8R7dT8= =uV7H -END PGP SIGNATURE- Current version is 1.61 | Using TBUDL information: http://www.silverstones.com/thebat/TBUDLInfo.html
Re: Regex Help
On 12-01-2001 at 18:00:27GMT -0800 (which was 2:00 where I live) Januk Aggarwal wrote regarding the subject of "Regex Help" Hello Januk, ME It outputs "" (meaning nothing) here. Januk Did you use cut and paste to put it into your QT? If not, did you That's what I did. I copied it 100% into my test QT. Januk accidentally use %REGEXPBLINDMATCH instead of %REGEXPMATCH? Are all Januk the quotation marks correct? Yep. Januk I cut and pasted this one into a QT, and this is the output: 20010111 Januk What is the output of the %ODATESHORT macro on your system? If it is Januk not digits separated by '/', the regexp will fail. 12-01-2001 Separator different, so this is it. Changing the regexp results: 20010112 Perhaps you could change the regexp to be generic regardles of the separator (/ in the US, DE etc, - in PT and perhaps there are others) Regards -- Manfred ___ [ TheBat 1.49c (FE1905D5), Windows 5.0 Build 2195 Service Pack 1, RC 1.1 ] Where do Ravens go for a drink?Crow Bars. -- -- View the TBUDL archive at http://tbudl.thebat.dutaint.com To send a message to the list moderation team double click here: mailto:[EMAIL PROTECTED] To Unsubscribe from TBUDL, double click here and send the message: mailto:[EMAIL PROTECTED] -- You are subscribed as : archive@jab.org
Re: Regex Help
Hello Nick, ND = Nick Danger On Thu, 11 Jan 2001 at 16:56:24 GMT -0600 (which was 2:56 PM where I live) witnesses say Nick Danger typed: ND Let me try another plea for help ND Is it possible to take today's date that is formatted 1/11/2001 by ND %DATESHORT and have it reformatted to a 20010111 style? (MMDD) Try %SETPATTREGEXP="\d{8}"%REGEXPMATCH="%SETPATTREGEXP=""(\d*)/(\d*)/(\d*)""%REGEXPBLINDMATCH=""%DATESHORT""%SUBPATT=""3""%SUBPATT=""2""%SUBPATT=""1"";;%SUBPATT=""3""0%SUBPATT=""2""%SUBPATT=""1""" This is what it outputs for me: 20010111 -- Thanks for writing, Januk Aggarwal Using The Bat! 1.49 under Windows 98 4.10 Build A -- -- View the TBUDL archive at http://tbudl.thebat.dutaint.com To send a message to the list moderation team double click here: mailto:[EMAIL PROTECTED] To Unsubscribe from TBUDL, double click here and send the message: mailto:[EMAIL PROTECTED] -- You are subscribed as : archive@jab.org
Re: Regex Help
On 11-01-2001 at 15:22:56GMT -0800 (which was 23:22 where I live) Januk Aggarwal wrote regarding the subject of "Regex Help" Hello Januk, Januk Try Januk %SETPATTREGEXP="\d{8}"%REGEXPMATCH="%SETPATTREGEXP=""(\d*)/(\d*)/(\d*)""%REGEXPBLINDMATCH=""%DATESHORT""%SUBPATT=""3""%SUBPATT=""2""%SUBPATT=""1"";;%SUBPATT=""3""0%SUBPATT=""2""%SUBPATT=""1""" Januk This is what it outputs for me: 20010111 It outputs "" (meaning nothing) here. Regards -- Manfred ___ [ TheBat 1.49c (FE1905D5), Windows 5.0 Build 2195 Service Pack 1, RC 1.1 ] Politeness is asking a beggar if he'll take a check. -- -- View the TBUDL archive at http://tbudl.thebat.dutaint.com To send a message to the list moderation team double click here: mailto:[EMAIL PROTECTED] To Unsubscribe from TBUDL, double click here and send the message: mailto:[EMAIL PROTECTED] -- You are subscribed as : archive@jab.org
Re: Regex Help
Hello Manfred, ME = Manfred Ell On Thu, 11 Jan 2001 at 23:32:02 GMT + (which was 3:32 PM where I live) witnesses say Manfred Ell typed: ME It outputs "" (meaning nothing) here. Did you use cut and paste to put it into your QT? If not, did you accidentally use %REGEXPBLINDMATCH instead of %REGEXPMATCH? Are all the quotation marks correct? I cut and pasted this one into a QT, and this is the output: 20010111 What is the output of the %ODATESHORT macro on your system? If it is not digits separated by '/', the regexp will fail. -- Thanks for writing, Januk Aggarwal Using The Bat! 1.49 under Windows 98 4.10 Build A -- -- View the TBUDL archive at http://tbudl.thebat.dutaint.com To send a message to the list moderation team double click here: mailto:[EMAIL PROTECTED] To Unsubscribe from TBUDL, double click here and send the message: mailto:[EMAIL PROTECTED] -- You are subscribed as : archive@jab.org
Re: Regex Help
Subject: Regex Help From: Januk Aggarwal Dated: Thu, 11 Jan 2001, 15:22:56 (5:22:56 PM Local) ~~ Hi Januk, J Try J %SETPATTREGEXP="\d{8}"%REGEXPMATCH="%SETPATTREGEXP=""(\d*)/(\d*)/(\d*)""%REGEXPBLINDMATCH=""%DATESHORT""%SUBPATT=""3""%SUBPATT=""2""%SUBPATT=""1"";;%SUBPATT=""3""0%SUBPATT=""2""%SUBPATT=""1""" J This is what it outputs for me: 20010111 Worked like a charm! A thousand thanks for making a mundane task automated for me. You're my hero for the day! -- |-|-| | Nick| "All the world's a game, | | | | Danger | and we are just niggly bits" | |-|-| | "We don't stop playing when we grow old, | | We grow old when we stop playing" | |---| MUA: The Bat! V:1.49 Beta/1 -- -- View the TBUDL archive at http://tbudl.thebat.dutaint.com To send a message to the list moderation team double click here: mailto:[EMAIL PROTECTED] To Unsubscribe from TBUDL, double click here and send the message: mailto:[EMAIL PROTECTED] -- You are subscribed as : archive@jab.org