dimanche 18 octobre 2020

How can I find all matching text that may contain spaces surrounded by a string pattern such as *** using regex in C++

I'm trying to find a solution that I can match strings inside a certain surrounding pattern using regex in c++ 11 I need several operations for this:

  1. Replace the text with asterisks (like passwords). For example, Original text: This is my password: ***Password 1 2 3***. Result: This is my password: ****.
  2. Remove the surroundings and display as clear text: For example, Original text: This is my password: ***Password 1 2 3***. Result: This is my password: Password 1 2 3.
  3. Get the text if it has multiple occurrences. For example, Original text: This is user: ***User1@gmail.com*** password: ***Password 1 2 3***. Result: This is user: User1@gmail.com password: Password 1 2 3.

Thanks

Aucun commentaire:

Enregistrer un commentaire