string src = "portfolio1, portfolio2, portfolio20, portfolio300";
I’d like to match all strings that are of the pattern @”portfolio\d”
where \d can be anywhere from 1-3 digits in length. I have read that the use of {a, b} should work, so I tried:
pattern = @"portfolio\d{1, 3}"
Searching in the string, src, for this pattern returned an empty set. the following patterns worked partially:
pattern = @"portfolio\d"
pattern = @"portfolio\d{1}"
Try this:
Note that you should not put a space in between the brackets, as you have in your example. That’s why it didn’t work right.