Re: Regex substitution trouble

2014-11-05 Thread Eugene
massi_...@msn.com wrote: > Hi everyone, > > I'm not really sure if this is the right place to ask about regular > expressions, but since I'm usin python I thought I could give a try :-) > Here is the problem, I'm trying to write a regex in order to substitute > all the occurences in the form $"

Re: Regex substitution trouble

2014-10-28 Thread Cameron Simpson
On 28Oct2014 04:02, massi_...@msn.com wrote: I'm not really sure if this is the right place to ask about regular expressions, but since I'm usin python I thought I could give a try :-) Here is the problem, I'm trying to write a regex in order to substitute all the occurences in the form $"some

Re: Regex substitution trouble

2014-10-28 Thread MRAB
On 2014-10-28 12:28, massi_...@msn.com wrote: Hi Chris, thanks for the reply. I tried to use look ahead assertions, in particular I modified the regex this way: newstring = re.sub(ur"""(?u)(\$\"[\s\w(?<=\\)\"]+\")""", subst, oldstring) but it does not work. I'm absolutely not a regex guru so I

Re: Regex substitution trouble

2014-10-28 Thread Tim
On Tuesday, October 28, 2014 7:03:00 AM UTC-4, mass...@msn.com wrote: > Hi everyone, > I'm not really sure if this is the right place to ask about regular > expressions, but since I'm usin python I thought I could give a try :-) > Here is the problem, I'm trying to write a regex in order to substi

Re: Regex substitution trouble

2014-10-28 Thread TP
On Tue, Oct 28, 2014 at 4:02 AM, wrote: > Hi everyone, > > I'm not really sure if this is the right place to ask about regular > expressions, but since I'm usin python I thought I could give a try :-) > Here is the problem, I'm trying to write a regex in order to substitute > all the occurences i

Re: Regex substitution trouble

2014-10-28 Thread Chris Angelico
(Please quote enough of the previous text to provide context, and write your replies underneath the quoted text - don't assume that everyone's read the previous posts. Thanks!) On Tue, Oct 28, 2014 at 11:28 PM, wrote: > Hi Chris, thanks for the reply. I tried to use look ahead assertions, in >

Re: Regex substitution trouble

2014-10-28 Thread massi_srb
Hi Chris, thanks for the reply. I tried to use look ahead assertions, in particular I modified the regex this way: newstring = re.sub(ur"""(?u)(\$\"[\s\w(?<=\\)\"]+\")""", subst, oldstring) but it does not work. I'm absolutely not a regex guru so I'm surely missing something. The strings I'm d

Re: Regex substitution trouble

2014-10-28 Thread Chris Angelico
On Tue, Oct 28, 2014 at 10:02 PM, wrote: > I'm not really sure if this is the right place to ask about regular > expressions, but since I'm usin python I thought I could give a try :-) Yeah, that sort of thing is perfectly welcome here. Same with questions about networking in Python, or file I/

Regex substitution trouble

2014-10-28 Thread massi_srb
Hi everyone, I'm not really sure if this is the right place to ask about regular expressions, but since I'm usin python I thought I could give a try :-) Here is the problem, I'm trying to write a regex in order to substitute all the occurences in the form $"somechars" with another string. This i