I have the following pattern of string:
The following class has been canceled:
Class: [abcde] Lorem Ipsum | 2020
Course: [fghi] Dolor - SIT AMED CONSECTUR
Account: [jklm] Sed Aliquet - Pellentesque lobortis
User: [nopq]
I would like in this case to have two regex patterns
- Regex pattern to select all the text except "abcde"
- Regex pattern to select all the text except the text after and before "[" "]" characters. That is, to select all the text except: "abcde" , "fghi", "jklm" and "nopq"
How can I do this using regex?