Yep, this can be easily done using RegEx. See this example which you should be able to adapt for your use case:
For more information, see the wiki Searching the Forum for Answers section.