I got an email from somebody named Lindrian about the article I had written about using regular expressions to find comments in source code: ostermiller.org/findcomment.html Lindrian sent me a link explaining how he had made improvements to the regular expressions I had used: regex101.com/r/wI3fU3
Many text editors have advanced find (and replace) features. I recently wrote an article about finding C style comments in source code. A similar technique can be used to find comments in HTML files.
Many text editors have advanced find (and replace) features. When I’m programming, I like to use an editor with regular expression search and replace. This feature is allows one to find text based on complex patterns rather than based just on literals. Upon occasion I want to examine each of the comments in my source code and either edit them or remove them. I found that it was difficult to write a regular expression that would find C style comments (the comments that start with /* and end with */) because my text editor does not implement the “non-greedy matching” feature of regular expressions.