Python Forum

Full Version: regular expression
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
HI, I am trying to write a re pattern in below example and following thread: let me know.

Thread: https://python-forum.io/Thread-regular-e...ion--27535

For example:

Text1 = [SYS_1] application [END]
Text2 = [Mobile_2] phone [END]

Text3 = [ABCD_1] text [END]

Text4 = [ABC_] some text [END]

Text5 = [ONE_N] some text [END]
.
.
TextN.......

For each Text needs to check with Regular Expression and match it

Here we need to match with Regular Expression to capture or extract the Text, looks like:
Now, write a one Regular expression for all Text:

Conditions : if SYS_1 and Mobile_2 match , then this are exclude.
if match Text3 or Text4 or Text5 these needs to capture or extract.

Thanks.
What have you tried so far?
Please show code attempts.
The following link includes the code and we tried so far: :https://python-forum.io/Thread-regular-e...ion--27535
why are you double posting?
Please don't we read all threads, and it's against the rules.
Okay, Any one can help to understand the implementation.