Can anyone explain me what this javascript patter actually looking for?
var pattern = /^\/.*\/$/i;
Can anyone explain me what this javascript patter actually looking for?
var pattern = /^\/.*\/$/i;
It looks for strings that:
Please note:
Here's he best tutorial on RegEx I've found on the Internet. You might've solved your problem just by looking at the table to the right on the page of the tutorial. Just spend an hour on this. It helped me a lot!
In the example you've provided:
^…$ Starts and ends
. Any Character
* Zero or more repetitions