user3657339
user3657339

Reputation: 627

Extract part of string using REGEX

I need to extract following from below string using REGEX, can anyone help

String = "[payment is made within [ 10  ] Business Days  of its due date.]"

Output:

[ 10  ] Business Days

Upvotes: 0

Views: 63

Answers (1)

nitzien
nitzien

Reputation: 1267

Please try this.

s/^\[payment is made within (\[ [0-9]* \]) Business Days.*$/\1 Business Days/

Upvotes: 1

Related Questions