小编Sho*_*Kei的帖子

适用于Linux文件权限的正则表达式(数字表示法)

我不能为我的生活找到适当的正则表达式.

我正在寻找的是匹配Linux文件权限的有效数字表示的正则表达式(例如,740表示全部读取,777表示全部全部).到目前为止,我已经尝试了以下内容:

strtotest=740
echo "$strtotest" | grep -q "[(0|1|2|3|4|5|7){3}]"
if [ $? -eq 0 ]; then
    echo "found it"
fi
Run Code Online (Sandbox Code Playgroud)

与上面的问题是,正则表达式匹配任何事1-57在里面,不管在任何其它字符.例如,如果strtotest要更改为709,则条件为真.我也试过了[0|1|2|3|4|5|7{3}],[(0|1|2|3|4|5|7{3})]但那些效果不好.

我正在使用正则表达式错误,还是我错过了必须处理的内容grep

regex linux bash grep

7
推荐指数
2
解决办法
1650
查看次数

嵌套<article> s在语义上是否正确?

我一直在阅读新的HTML5元素及其适当的用法,目前有一些这样的标记:

    <article>
        <h1>Crazy Awesome Programming Projects</h1>
        <article>
            <h2>Mathematics</h2>

            <section>
                <h3>Binary to Decimal converter</h3>
                <p> info here </p>
            </section>

            <section>
                <h3>Scientific Calculator</h3>
                <p> info here </p>
            </section>

        </article>

        <article>
            <h2>String Manipulation</h2>

            <section>
                <h3>RSS Feed Generator</h3>
                <p> info here </p>
            </section>

            <section>
                <h3>Palindrome Detector</h3>
                <p> info here </p>
            </section>
        </article>
    </article>
Run Code Online (Sandbox Code Playgroud)

<article>以这种方式嵌套标签在语义上是否正确?提前致谢

html article html5 semantics

4
推荐指数
2
解决办法
2121
查看次数

标签 统计

article ×1

bash ×1

grep ×1

html ×1

html5 ×1

linux ×1

regex ×1

semantics ×1