One more regular expressions question

2007-01-18 Thread Victor Polukcht
I have a couple of strings like: Unassigned Number (1)32 No Route To Destination (3) 12 Normal call clearing (16) 2654 User busy (17) 630 No user

Re: One more regular expressions question

2007-01-18 Thread Roberto Bonvallet
Victor Polukcht wrote: My actual problem is i can't get how to include space, comma, slash. Post here what you have written already, so we can tell you what the problem is. -- Roberto Bonvallet -- http://mail.python.org/mailman/listinfo/python-list

Re: One more regular expressions question

2007-01-18 Thread Peter Otten
Victor Polukcht wrote: I have a couple of strings like: Unassigned Number (1)32 No Route To Destination (3) 12 Normal call clearing (16) 2654 User busy (17)

Re: One more regular expressions question

2007-01-18 Thread Victor Polukcht
My pattern now is: (?Pvar1[^(]+)(?Pvar2\d+)\)\s+(?Pvar3\d+) And i expect to get: var1 = Unassigned Number var2 = 1 var3 = 32 I'm sure my regexp is incorrect, but can't understand where exactly. Regex.debug shows that even the first block is incorrect. Thanks in advance. On Jan 18, 1:15 pm,

Re: One more regular expressions question

2007-01-18 Thread Daniele Varrazzo
Victor Polukcht wrote: I have a couple of strings like: Unassigned Number (1)32 [...] Interworking, unspecified (127) 5 I need to get: Error code (value in brackets) - Value - Message. My actual problem is i can't get how to

Re: One more regular expressions question

2007-01-18 Thread harvey . thomas
Victor Polukcht wrote: My pattern now is: (?Pvar1[^(]+)(?Pvar2\d+)\)\s+(?Pvar3\d+) And i expect to get: var1 = Unassigned Number var2 = 1 var3 = 32 I'm sure my regexp is incorrect, but can't understand where exactly. Regex.debug shows that even the first block is incorrect. Thanks

Re: One more regular expressions question

2007-01-18 Thread Victor Polukcht
Great thanks. You post helped me so much! My resulting regexp is: (?Pvar1^(.*)\s*)\(((?Pvar2\d+))\)\s+((?Pvar3\d+)) On Jan 18, 2:38 pm, Daniele Varrazzo [EMAIL PROTECTED] wrote: Victor Polukcht wrote: I have a couple of strings like: Unassigned Number (1)

Re: One more regular expressions question

2007-01-18 Thread Jussi Salmela
Victor Polukcht kirjoitti: Great thanks. You post helped me so much! My resulting regexp is: (?Pvar1^(.*)\s*)\(((?Pvar2\d+))\)\s+((?Pvar3\d+)) If it doesn't have to be a regex: #=== s = '''\ Unassigned Number (1)

Re: One more regular expressions question

2007-01-18 Thread Daniele Varrazzo
Victor Polukcht wrote: Great thanks. You post helped me so much! My resulting regexp is: (?Pvar1^(.*)\s*)\(((?Pvar2\d+))\)\s+((?Pvar3\d+)) Notice that this way you are including trailing whitespaces in the var1 group. You may want to put the \s* outside the parenthesis. mmm... in this case

Re: One more regular expressions question

2007-01-18 Thread Neil Cerutti
On 2007-01-18, Victor Polukcht [EMAIL PROTECTED] wrote: My pattern now is: (?Pvar1[^(]+)(?Pvar2\d+)\)\s+(?Pvar3\d+) And i expect to get: var1 = Unassigned Number var2 = 1 var3 = 32 I'm sure my regexp is incorrect, but can't understand where exactly. Break it up using verbose notation