Why there are (dollar) slashy strings since they can be interchanged with quote ones and then can be spared for other syntax usage? Is there any proof of their irreplaceability?
If you're defining a regular expression pattern, then slashy strings are useful as you don't need to escape backslashes, e.g.
/\s+/
However, if you need a forward slash in your pattern, you'd need a dollar slashy string, e.g.
$/([a-z]+)/([a-z]+)/$
Or see the docs
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