How to extract a pattern from a string in typescript code example
Example 1: js array find regex
const array = ["page=4", "sortOrder=asc", "datePosted=all-time", "sortOrder=desc"];
const match = array.find(value => /^sortOrder=/.test(value));
// match = "sortOrder=asc"
Example 2: regex to get part of word nodejs
/\(\{#(.*?)#\})\)/g.exec("({#test#})")[1] === "test"