I need a RegEx to leave only what is between the square brackets [ ], this is an example of the text:
HM-WP-MB-22NOV10-03[24MO+36MO+6YE+12YE RED] MPD R00
HM-WP HC-UUI MAY20 [24M+36M+6Y+12U]
You must provide the following for this example:
[24MO+36MO+6YE+12YE RED]
[24M+36M+6Y+12U]
It only works what is inside the [ ]
To extract the text that is enclosed in square brackets , use the regular expression:
In this way, for example:
Departure:
Explanation:
\[
:[
is a special character and needs to be escaped\
so that it can be found literally.(.*?)
: matches any character. You can change it to a different expression to match only letters, numbers, etc.\]
:]
is a special character, so it is treated the same as the first[