On 27/05/2014 12:39, Aman Kashyap wrote:
On Tuesday, 27 May 2014 16:59:38 UTC+5:30, Daniel  wrote:
What about skipping the re and try this:


On 27.05.2014 14:09, Vlastimil Brom wrote:

2014-05-27 12:59 GMT+02:00 Aman Kashyap <amankashyap1...@gmail.com>:

I would like to create a regular expression in which i can match the "|" 
special character too.



I want to only |ID=ter54rt543d| from the above string but i am unable to write the  
pattern match containing "|" pipe too.

By default python treat "|" as an OR operator.

But in my case I want to use to as a part of search string.



you can just escpape the pipe with backlash like any other metacharacter:


be sure to use the raw string notation r"...", or you can double all

backslashes in the string.



Thanks for the response.

I got the answer finally.

This is the regular expression to be 

I'm pleased to see that you have answers. In return would you please use the mailing list https://mail.python.org/mailman/listinfo/python-list or read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing double line spacing and single line paragraphs, thanks.

My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language.

Mark Lawrence

This email is free from viruses and malware because avast! Antivirus protection 
is active.


Reply via email to