I’m looking to build a regular expression that will allow me to replace the periods (.) in a filename with an underscore (_).
Example: replace filename.doc with filename_doc
I’ve had a play around in Expresso, and have worked out that it will be something like .\w{3,4) – to pick up 3 or 4 character extentions eg doc, docx, xls, xlsx etc.
But I cannot figure out how to replace only the period and retain the extention.
You have to escape
.sign. Try with following regex:And replace it with:
$1contains matched string in()