课程: Linux: Files and Permissions

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Using character classes

Using character classes

- Linux also provides a mechanism for matching certain character classes. A character class is a grouping of light characters. For instance, letters, numbers, punctuation, and so on. There is support for various character classes at Bash, so let's get into it. Instead of including all characters you want to match, you could use a class. To match whole numbers, use the digit character class. This would be equivalent to using a range of zero through nine. Sometimes the syntax is more complex using character classes, but they're ultimately more powerful and reliable than character sets alone, so I do recommend using them. To match uppercase characters, we can use the upper class. This is equivalent to uppercase A through Z. For lowercase letters, use the lower class, which is equivalent to lowercase A through Z. If you want to match both upper and lower case characters, use the alpha character class, which would be equivalent…

内容