I have this following String below
[01]ABC0007[0d0a]BB BABLOXC[0d0a]067989 PLPXBNS[0d0a02]BBR OIC002 L5U0/P AMD KAP 041800 T1200AND 2+00[0d0a0b03]
And I am attempting to replace all [..]
with spaces.
What I have tried.
return this.text.replace(new RegExp('[0d0a] | [0d0a02] | [0d0a02]' ) , ' ')
return this.text.replace(new RegExp('\[0d0a\] | \[0d0a02\] | \[0d0a02\]' ) , ' ')
What works is only this.
return this.text.replace(new RegExp('0d0a') , ' ')
Posts in this one here involve multiple steps. This is going to be used as input as 'javascript' string to the Bson filter for mongo queries since mongo does not yet have REPLACE function like SQL has. There is a open request.