2

In regex, I think I want .*\..* -> Match all files with any characters, single dot, all characters.

In unix filenaming pattern matching, is there a way to do this as *.* matches filenames with two . in them. It will match release_4.18.1 file when I only want it to match all the release_4.18 files.

I am using github branch protection name matching so I can't do fancy commands either in bash or anything :(

ilkkachu
  • 308
  • 2
  • 8
Dean Hiller
  • 911
  • 4
  • 15
  • 35

1 Answers1

3

Something like this perhaps

^[^.]*\.[^.]*$
  • Here we match any number of non-dot characters via [^.]* then a single dot, then any number of non-dot characters again.

  • As a dot in regex means match any character we escape it to match a literal dot.

  • The ^ and $ are start and end of string markers so we don't match more than one thing.

Robert Longson
  • 325
  • 2
  • 11