I am struggling to find a regex for Akeeba Backup (3.11.0), that will exclude specific hidden files that start with ._ (dot underscore) in all directories of the website. Have anyone ever done this?

Here what I have tried that is closer to what I want, among other regex, but they don't work.
#^\._# & [^\._]

  • Try using /^._/s
    – Lodder
    May 14, 2014 at 9:30
  • nop - it doesn't work
    – FFrewin
    May 14, 2014 at 9:41

2 Answers 2


Finally I got the correct answer from Akeeba support. The regex that works in this case is :


All credits go to Nicholas from Akeeba.

  • Just a small note, this could also be written more basically as #(^|/)\._#. Match either from the beginning of the string or from a literal forward slash (anywhere in the string), followed immediately by a literal dot, followed by an underscore.
    – mickmackusa
    Jun 24, 2018 at 8:02

I think it just uses preg_match() so I would try using a tool like regex101 with the pcre flavour to build your match pattern.

Have you tried with out the delimiters, i.e. something simple like ^\._

  • I have tried without the delimiters. The ^\._ it doesn't work. However the \._ works but it will match all files that contain ._ in their filename.
    – FFrewin
    May 14, 2014 at 9:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.