I need to trim a space after '[' and before ']'.
To trim a space after '[', String.replace(/\[ /g, '['); works;
however, to trim a space before ']', String.replace(/ \]/g, ']'); seems not working.
What is the proper regex for that?
JavaScript.
I need to trim a space after '[' and before ']'.
To trim a space after '[', String.replace(/\[ /g, '['); works;
however, to trim a space before ']', String.replace(/ \]/g, ']'); seems not working.
What is the proper regex for that?
JavaScript.