You can use the match
method in Typescript with the following regex expression to match /168-market
in the given string:
index.ts140 chars6 lines
In the above example, the regular expression /\/\d+-\w+/
matches any sequence of digits, letters, or underscore preceded by a forward slash (/
). The match
method returns an array containing the matching substring(s).
gistlibby LogSnag