Re: Regex for matching files that don't have type extensions

2016-11-05 Thread Shawn H Corey
On Sat, 05 Nov 2016 21:30:12 + Aaron Wells wrote: > True. It could get hairy. Unicode is a pretty vast landscape, and I > think if you only want ASCII word characters to count as things that > could be in a filename, your original [A-Za-z0-9_] is your best bet. > Thanks to the others for thei

Re: Regex for matching files that don't have type extensions

2016-11-05 Thread Octavian Rasnita
From: Aaron Wells True. It could get hairy. Unicode is a pretty vast landscape, and I think if you only want ASCII word characters to count as things that could be in a filename, your original [A-Za-z0-9_] is your best bet. Thanks to the others for their comments. As Ken says: there are pro

Re: Regex for matching files that don't have type extensions

2016-11-05 Thread X Dungeness
On Sat, Nov 5, 2016 at 10:55 AM, Jovan Trujillo wrote: > Hi Aaron, >In perlre I read that \w > " > > \w[3] Match a "word" character (alphanumeric plus "_", plus > other connector punctuation chars plus > Unicode >

Re: Regex for matching files that don't have type extensions

2016-11-05 Thread Aaron Wells
True. It could get hairy. Unicode is a pretty vast landscape, and I think if you only want ASCII word characters to count as things that could be in a filename, your original [A-Za-z0-9_] is your best bet. Thanks to the others for their comments. As Ken says: there are probably more ways to code th

Re: Regex for matching files that don't have type extensions

2016-11-05 Thread Kent Fredric
On 6 November 2016 at 06:14, Jovan Trujillo wrote: > > 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. Alternatively, if your use case allows it, it m

Re: Regex for matching files that don't have type extensions

2016-11-05 Thread Ken Slater
Hi Jovan, On Sat, Nov 5, 2016 at 1:14 PM, Jovan Trujillo 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\_]+/ wou

Re: Regex for matching files that don't have type extensions

2016-11-05 Thread Jovan Trujillo
Hi Aaron, In perlre I read that \w " - \w[3] Match a "word" character (alphanumeric plus "_", plus - other connector punctuation chars plus Unicode - marks) " So since I didn't know what these 'other' con

Re: Regex for matching files that don't have type extensions

2016-11-05 Thread Aaron Wells
*predefined On Sat, Nov 5, 2016, 10:27 AM Aaron Wells wrote: > Hi Jovan. \w is a presidents character classes that is equivalent to > [A-Za-z0-9_], so this works also: > m/^\w+$/ > > On Sat, Nov 5, 2016, 10:24 AM Jovan Trujillo > wrote: > > Ah, I figured it out. > m/^[A-Za-z0-9_]+$/ works beca

Re: Regex for matching files that don't have type extensions

2016-11-05 Thread Aaron Wells
Hi Jovan. \w is a presidents character classes that is equivalent to [A-Za-z0-9_], so this works also: m/^\w+$/ On Sat, Nov 5, 2016, 10:24 AM Jovan Trujillo wrote: > Ah, I figured it out. > m/^[A-Za-z0-9_]+$/ works because it will only match if the entire string > follows the pattern. Thanks! >

Re: Regex for matching files that don't have type extensions

2016-11-05 Thread Jovan Trujillo
Ah, I figured it out. m/^[A-Za-z0-9_]+$/ works because it will only match if the entire string follows the pattern. Thanks! On Sat, Nov 5, 2016 at 10:14 AM, Jovan Trujillo wrote: > Hi All, > I thought I could use a simple regex to match files like this: > > 1207003PE_GM_09TNPLM2 > > and

Regex for matching files that don't have type extensions

2016-11-05 Thread Jovan Trujillo
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