Yeah, I'm trying to remove everything except the capital letters, though it doesn't really seem to go well.
I used the following code,
String.replace(/(?![A-Z])./, '');
It doesn't seem to work properly, while it does work using PHP.
Add the global
option at the end of the regex
- see demo below:
console.log("AkjkljKK".replace(/(?![A-Z])./g, ''));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With