Thanks to everyone who responded. The query was in fact obscure since I didn't use the <code>
tag. Please find the query in a proper format below.
I have a file called names.txt with the following content
I was trying to extract the initials placed between special characters [ and ] and output this to a new file initials.txt as
I hope that I have clarified the question. Thanks once again to those who guided me the correct regex. Regards, PS.