Page 406 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 406
정보통신기기 프로젝트
$string1="Hello World\n";
if($string1=~m/llo\b/){
print"There is a word that ends with 'llo'\n";
\b }
출력:
There is a word that ends with 'llo'
$string1="Hello World\n";
if($string1=~m/\w/){
print"There is at least one alphanumeric ";
print"character in $string1 (A-Z, a-z, 0-9, _)\n";
"_"를 포함한 영숫
\w }
자를 일치시킨다.
출력:
There is at least one alphanumeric character in Hello World
(A-Z, a-z, 0-9, _)
$string1="Hello World\n";
if($string1=~m/\W/){
print"The space between Hello and ";
"_"를 제외하여 영 print"World is not alphanumeric\n";
\W 숫자가 아닌 문자
열들과 일치시킨다. }
출력:
The space between Hello and World is not alphanumeric
$string1="Hello World\n";
if($string1=~m/\s.*\s/){
print"There are TWO whitespace characters, which may";
print" be separated by other characters, in $string1";
공백 문자와 일치
\s }
시킨다.
출력:
There are TWO whitespace characters, which may be
separated by other characters, in Hello World
정보통신기기과
- 399 -