regex to get part of word nodejs 1

regex to get part of word nodejs

/\(\{#(.*?)#\})\)/g.exec("({#test#})")[1] === "test"

Here is what the above code is Doing:
1. The first line is a regular expression literal.
2. The second line is a test to see if the regular expression matches the string.
3. The third line is a test to see if the regular expression matches the string and if the first capturing group matches the string.
4. The fourth line is a test to see if the regular expression matches the string and if the first capturing group matches the string.

Similar Posts