Sort by

recency

|

113 Discussions

|

  • + 0 comments

    Does Bash-online-complier supports control structure as loops and conditional statment ?

    the following command works correctly on my local Unix-based system, but it does not behave as expected in the online compiler!!

    sed -E '/^([0-9]{4}\s*){4}$/{:a /(\*\*\*\*\s+){3}/b; s/((\*\*\*\*\s+)*)?[0-9]+/****/; ta} -' 
    
  • + 0 comments

    By using grouping, i found this solution

    sed -E 's/([0-9]{4}\s){3}([0-9]{4})/**** **** **** \2/g'

  • + 0 comments

    Simple Solution

    sed -E 's/[0-9]{4} /**** /g'
    
  • + 1 comment

    my answer

    sed -E 's/\d{4} /**** /g'
    
  • + 0 comments

    Not a pretty solution but it works.

    sed 's/\d\{4\} \d\{4\} \d\{4\}/**** **** ****/1'