help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linux file name definition is..


From: Dennis Williamson
Subject: Re: Linux file name definition is..
Date: Mon, 18 Sep 2023 14:27:58 -0500

On Mon, Sep 18, 2023 at 1:54 PM Budi <budikusasi@gmail.com> wrote:

> One please state definitvely Linux file name definition is in Posix regex
> ?.
>
>
^[^/]+$ seems pretty good to me. I don't think you need to put a null in
there.

If you mean the portable filename character set (
https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/basedefs/V1_chap03.html#tag_03_282)
then:

^[A-Za-z0-9._-]+$

Both of these are ERE (extended regular expressions) because of the plus
sign. The second would need to be in a POSIX locale, I think, in order to
avoid the ranges not doing what you want.

-- 
Visit serverfault.com to get your system administration questions answered.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]