o0zi
07-10-2005, 11:21 AM
I'm afraid I've come across a rather thorny problem involving regular expressions - say I have a regexp compiled using regcomp, and I have a string to match it against. How do I highlight every instance of the regular expression in the string?
I've got the highlight and unhighlight terminal ANSI escape sequences (which I absolutely have to use, I'm afraid), but I just don't get how to match substrings and then highlight them. Any ideas, or even better, code (I'm stuck, so I'm scraping the bottom of the barrel here...)?
I've got the highlight and unhighlight terminal ANSI escape sequences (which I absolutely have to use, I'm afraid), but I just don't get how to match substrings and then highlight them. Any ideas, or even better, code (I'm stuck, so I'm scraping the bottom of the barrel here...)?