Regex – Search for Name of Current File
I want to write a regular expression that matches the name of the file currently being searched.
The purpose is to find hyperlinks in an HTML file which point to the file itself, but without the # character in the href attribute. Such links are almost always a mistake, but apps which look for broken links don’t find it, because the link isn’t broken (it points to its own file!).
I Googled for this kind of regex, but the only hits returned were on how to extract file names from paths, which isn’t what I need.
Is it possible to match the name of the current file in a regular expression?
Read more here: Source link