So I'm basically trying to match words in a string that may or may not contain hyphens. For instance, in the strings below:
let firstStr = "filter-table";
let secondStr = "filter-second-table";
"filter-" is a required keyword, and so, I'd want to match the words containing "filter-" followed by any character/word (hyphenated or not).
Using the following:
secondStr.match(/filter-\w+/);
"firstStr" matches correctly but not "secondStr". "secondStr" only matches "filter-second" and not the hyphenated word after - "filter-second-table".
I'd want to be able to match any potential hyphenated word as in "second-table".