You use Regular Expressions. RegExp.
There are a lot of special ways you can match different parts of the title.
Because [ and ] has a special meaning in RegExps you have to "escape" them using a backslash to match them. This will match anything surrounded by []:
\[.*\]
This will match a single digit number:
\d
This will match a number, single digit or multiple digits.
\d+
You group patterns using ( ) so you can reference each matching group by number later. \1, \2 and so on.
In your case you could use this RegExp:
(.*) \[(.*) (\d+)\]
\1 = The part of the title before the [].
\2 = The name of the series.
\3 = The number of the book in the series.
(Not tested...)
There is a lot more to this. Check this thread for an actual example of how to use search and replace using RegExps:
https://www.mobileread.com/forums/sho...43#post2242243