I have this regex that extracts anything inside braquets:
[^[\]]+(?=])
1) I want to extract the content within the brackets as a whole if it contains letters only (a-z)
2) I want to extract the content within the brackets as a whole if it contains numbers only (0-9)
So, I need 2 regex.
Try this
(?<=\[)[a-zA-Z]+(?=\])
Demo
(?<=\[)[0-9]+(?=\])
Demo
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