Matching plurals using regex in C#
问题 I'm looking to use regex in C# to search for terms and I want to include the plurals of those terms in the search. For example if the user wants to search for 'pipe' then I want to return results for 'pipes' as well. So I can do this... string s ="\\b" + term + "s*\\b"; if (Regex.IsMatch(bigtext, s) { /* do stuff */ } How would I modify the above to allow me to match, say, 'stresses' when the user enters 'stress' and still work for 'pipe'/'pipes'? 回答1: Here's a regex created to remove the