使用REGEX提取部分字符串

时间:2018-09-29 18:25:44

标签: regex

我需要使用REGEX从下面的字符串中提取以下内容,任何人都可以帮忙

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

输出:

[ 10  ] Business Days

1 个答案:

答案 0 :(得分:1)

请尝试这个。

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