Hi Jovan, On Sat, Nov 5, 2016 at 1:14 PM, Jovan Trujillo <jovan.trujil...@gmail.com> wrote:
> Hi All, > I thought I could use a simple regex to match files like this: > > 1207003PE_GM_09TNPLM2 > > and ignore files with extensions like this: > > 1207003PE_GM_09TNPLM2.csv > > I originally though m/[A-Za-z0-9\_]+/ would work, but it captures both > strings. > So then I tried m/[A-Za-z0-9\_]+(?!\.)/ but I still get both strings > captured. > > What am I doing wrong? > > Thank you, > Jovan > The regular expression *m/[A-Za-z0-9\_]+(?!\.)/* will match, as it will match one or more of the desired characters (*1207003PE_GM_09TNPLM*) that are followed by a character (*2*) that is not a period/dot. There are probably many ways to code this. The simplest may be to run two regular expressions - the first to determine if there is a period/dot (*.*) in the string. HTH, Ken