zoukankan      html  css  js  c++  java
  • linux 正则表达式

    redis-cli INFO|tr -d ' '|egrep -v '^(#.*)?$'|sed -E 's/^([^:]*):(.*)$/redisInfo[1]="2"/'

    redis_version:4.0.0
    redis_git_sha1:00000000
    redis_git_dirty:0
    变为:

    redisInfo[redis_version]="4.0.0"
    redisInfo[redis_git_sha1]="00000000"
    redisInfo[redis_git_dirty]="0"

    ========================================================================

    将#开头的换为空行

    sed -i 's/#.*$//g' /etc/my.cnf

    删掉空行

    sed -i '/^$/d' /etc/my.cnf

    删掉第七行

    sed -i '7d' /etc/my.cnf

    =========================================================================

    <input[^(>[\s\S]*?<)]*?hidden[^(>[\s\S]*?<)]*?/>      匹配 包含 hidden 的 <input ... />

  • 相关阅读:
    04.
    24
    39
    46
    72.
    21.
    logout: not found”
    Username is not in the sudoers file. This incident will be reported
    激活函数
    排序算法
  • 原文地址:https://www.cnblogs.com/mhc-fly/p/7273387.html
Copyright © 2011-2022 走看看