ऑनवर्क्स लिनक्स और विंडोज ऑनलाइन वर्कस्टेशन

प्रतीक चिन्ह

वर्कस्टेशन के लिए मुफ्त होस्टिंग ऑनलाइन

<पिछला | विषय-सूची | अगला>

+ - एक तत्व का एक या अधिक बार मिलान करें

RSI + metacharacter works much like the *, except it requires at least one instance of the preceding element to cause a match. Here is a regular expression that will only match lines consisting of groups of one or more alphabetic characters separated by single spa- ces:

^([[:alpha:]]+ ?)+$


[मुझे@लिनक्सबॉक्स ~]$ echo "This that" | grep -E '^([[:alpha:]]+ ?)+$'

This that

[मुझे@लिनक्सबॉक्स ~]$ echo "a b c" | grep -E '^([[:alpha:]]+ ?)+$'

एबीसी

[मुझे@लिनक्सबॉक्स ~]$ echo "a b 9" | grep -E '^([[:alpha:]]+ ?)+$'

[मुझे@लिनक्सबॉक्स ~]$ echo "abc d" | grep -E '^([[:alpha:]]+ ?)+$'

[मुझे@लिनक्सबॉक्स ~]$

[मुझे@लिनक्सबॉक्स ~]$ echo "This that" | grep -E '^([[:alpha:]]+ ?)+$'

This that

[मुझे@लिनक्सबॉक्स ~]$ echo "a b c" | grep -E '^([[:alpha:]]+ ?)+$'

एबीसी

[मुझे@लिनक्सबॉक्स ~]$ echo "a b 9" | grep -E '^([[:alpha:]]+ ?)+$'

[मुझे@लिनक्सबॉक्स ~]$ echo "abc d" | grep -E '^([[:alpha:]]+ ?)+$'

[मुझे@लिनक्सबॉक्स ~]$


We see that this expression does not match the line “a b 9”, because it contains a non-al- phabetic character; nor does it match “abc d”, because more than one space character separates the characters “c” and “d”.


OnWorks पर शीर्ष OS क्लाउड कंप्यूटिंग: