dws' answer is sufficient for solving your problem, but I'd like to add that you could increase speed a little by taking out the /i: use and require will have to be lower cased, and \w already is [A-Za-z0-9_].
If you don't use $1, you can write (?:use|require) instead of (use|require), for a little extre speed-up. Note that the current $2 will be $1 if you do so.