0

https://regex101.com/r/2qRBV7/1

I am trying to get the base64 part of the following (including the base64: portion) with this regular expression:

.+\[?(.+?)\]?

and with this example text:

Application key [base64:HlOiabVcCmzUvcnPuCHCOS6nvS89otzCBXKb/PVbI1g=] set successfully.

Or this text (this is also an example result):

base64:zI1EaQeidtfpLwE9b8sGo5sZDbnzAqULCnL2hT3HoJo=

When I run it though, it matches the entire string.

barry-johnson
  • 3,113
  • 1
  • 14
  • 19
Get Off My Lawn
  • 27,770
  • 29
  • 134
  • 260

1 Answers1

1

How about this one:

base64:([^\] \b]*)

Here is a regex101 example:
https://regex101.com/r/2qRBV7/2

Catch every char that is not ], and \b(=word boundry) after a base64:

Dekel
  • 53,749
  • 8
  • 76
  • 105