Question about regular expression

2015-09-30 Thread massi_srb
Hi everyone, firstly the description of my problem. I have a string in the following form: s = "name1 name2(1) name3 name4 (1, 4) name5(2) ..." that is a string made up of groups in the form 'name' (letters only) plus possibly a tuple containing 1 or 2 integer values. Blanks can be placed betwe

Help with Regular Expression

2015-05-19 Thread massi_srb
Hi everyone, I succesfully wrote a regex in python in order to substitute all the occurences in the form $"somechars" with another string. Here it is: re.sub(ur"""(?u)(\$\"[^\"\\]*(?:\\.[^\"\\]*)*\")""", newstring, string) Now I would need to exclude from the match all the string in the form $"

Threading: execute a callback function in the parent thread

2015-03-20 Thread massi_srb
Hi everyone, just like the title says I'm searching for a mechanism which allows to call a callback function from a thread, being the callback executed in the parent thread (it can also be the main thread). I'm basically looking for something like the CallAfter method of the wx or the signal sl

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

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