Hope this helps,while(<DATA>){ @words=split; for(@words){ /(?:(the|or|and)|\w+) #Capture "the|or|and" (?(1) #Switch on captured value (?{print"$_ "}) #If there is a captured value just print |(?{print "\u\L$_ "}))#If not convert first char uppercase /x; } } __DATA__ red hot chili peppers, by the way
In reply to Re: RegExp Capitalization of Entry
by insensate
in thread RegExp Capitalization of Entry
by bladx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |