0

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

  1. Regex pattern to select all the text except "abcde"
  2. 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?

  • Looks like you are looking to create a regex, but do not know where to get started. Please check [Reference - What does this regex mean](https://stackoverflow.com/questions/22937618) resource, it has plenty of hints. Also, refer to [Learning Regular Expressions](https://stackoverflow.com/questions/4736) post for some basic regex info. Once you get some expression ready and still have issues with the solution, please edit the question with the latest details and we'll be glad to help you fix the problem. – Wiktor Stribiżew Sep 07 '20 at 21:13

0 Answers0