Perl Regular Expressions Question?

adtither

New member
This is from a past exam paper that i don't have the answers to. I just want to make sure i chose the correct answer.

To remove duplicate white-space characters use the perl RE:
a. /\s{2,}//gi
b. s/\s{2,}//i
c. s/\s{2,*}//gi
d. s/\s{2,}//gi

I went for C but i don't fully understand RE's
Any help would be appreciated!
Thanks!
 
Back
Top