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' connection punctuation chars are
I avoided it. Unicode makes things more complicated for me. Do you know?


Thanks,

Jovan

On Sat, Nov 5, 2016 at 10:27 AM, Aaron Wells <chacewe...@gmail.com> wrote:

> *predefined
>
> On Sat, Nov 5, 2016, 10:27 AM Aaron Wells <chacewe...@gmail.com> 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 <jovan.trujil...@gmail.com>
>> 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!
>>
>> On Sat, Nov 5, 2016 at 10:14 AM, 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
>>
>>
>>

Reply via email to