I’m trying to find the proper regular expression to select a term if it does NOT include hyphens. For example, I want to find the term debt but not debt-to-income.
I’ve got \bdebt-to-income\b which will select just debt-to-income, but I need the opposite. Help!
Use the following pattern: “debt” not followed by “-to-income”
This pattern can easily be expanded to restrict more, for example “
debt-of-the-usa“:You should not just look for a hyphen, because
debt-free(whendebt-freemeans nothing) should also be matched, probably.