[Ilugc] python regex - question

2014-06-17 Thread Mohan R
Hello Regex Gurus, I need help handling this particular situation In a log file, I have a line like this, 2014-06-17 13:55:14: IncomingData: TMSUpdateCallback: { SourceID=JP000456712 Ric=0388.HK BuyQty=3800.0 TradeTime="2014-06-17 13:54:19" DestID="" ExchangeTransCode="65725497 89897456 523 1" A

Re: [Ilugc] python regex - question

2014-06-17 Thread Girish Venkatachalam
Your approach is wrong, use find() to start the splitting with '='. I shall send you code soon. Hold on. No regex needed. On Tue, Jun 17, 2014 at 9:57 PM, Mohan R wrote: > Hello Regex Gurus, > > I need help handling this particular situation > > In a log file, I have a line like this, > > 2014-

Re: [Ilugc] python regex - question

2014-06-18 Thread Arun Khan
On Tue, Jun 17, 2014 at 9:57 PM, Mohan R wrote: > Hello Regex Gurus, > > I need help handling this particular situation > > In a log file, I have a line like this, > > 2014-06-17 13:55:14: IncomingData: TMSUpdateCallback: > { SourceID=JP000456712 Ric=0388.HK BuyQty=3800.0 TradeTime="2014-06-17 > 1

Re: [Ilugc] python regex - question

2014-06-18 Thread Girish Venkatachalam
Better one; import re feedstr = '2014-06-17 13:55:14: IncomingData: TMSUpdateCallback: { SourceID=JP000456712 Ric=0388.HK BuyQty=3800.0 TradeTime="2014-06-17 13:54:19" DestID="" ExchangeTransCode="65725497 89897456 523 1" Account="PTBHK01" }'; start = feedstr.find('{'); s = feedstr[start+1:] d

Re: [Ilugc] python regex - question

2014-06-18 Thread Girish Venkatachalam
import re feedstr = '2014-06-17 13:55:14: IncomingData: TMSUpdateCallback: { SourceID=JP000456712 Ric=0388.HK BuyQty=3800.0 TradeTime="2014-06-17 13:54:19" DestID="" ExchangeTransCode="65725497 89897456 523 1" Account="PTBHK01" }'; start = feedstr.find('{'); s = feedstr[start+1:] def spaceinquo

Re: [Ilugc] python regex - question

2014-06-18 Thread Udaya Kumar
On Tue, Jun 17, 2014 at 9:57 PM, Mohan R wrote: > Hello Regex Gurus, > > I need help handling this particular situation > > In a log file, I have a line like this, > > 2014-06-17 13:55:14: IncomingData: TMSUpdateCallback: > { SourceID=JP000456712 Ric=0388.HK BuyQty=3800.0 TradeTime="2014-06-17 >

Re: [Ilugc] python regex - question

2014-06-18 Thread AJIT KUMAR
Hi Uday, Nice solution. Hat off !!! function code using your re. import re data='SourceID=JP000456712 Ric=0388.HK BuyQty=3800.0 TradeTime="2014-06-17 13:54:19" DestID="" ExchangeTransCode="65725497 89897456 523 1"Account="PTBHK01"' def parse_input(data): my_dict={} #convert into a list

Re: [Ilugc] python regex - question

2014-06-18 Thread Mohan R
On Wed, 2014-06-18 at 14:48 +0530, Udaya Kumar wrote: > How are you? If this is related to office work, then you owe me! :) > Check whether this fits your req. Yeah :) I owe you a drink party!! > result = re.findall("\w+=.+?(?=\s+\w+=|\s+})",feedstr,re.M|re.I|re.X) wow!! I never thought there is