Friday, May 6, 2016

regex

Matches the starting position within the string
Matches the ending position within the string


^10[1-9]{6}$    ("10" followed by 6 digits)
^10.{6}$           ("10" followed by any 6 characters)

  • mystring/   followed by two or three digits
    • sed -r 's/.*mystring\/([0-9]{2,3}).*/\1/g'
.

No comments: