i want to match for all "/table[number]"
so strings like "/table[1]" and "/table" are matched.
i want to match for all "/table[number]"
so strings like "/table[1]" and "/table" are matched.
Depending upon your needs, you may want to throw in word boundary markers as well. So
/\b\/table(?:\[\d+\])?\b/
Without these the regex would match strings like
/tables
/tableTop
.....