in reply to Re: String Substitution Operator
in thread String Substitution Operator
How do I :
convert a string in day-month-year format to the dd-mm-yy format?
I use :$string =~ s/(\W)/-/x;
But the book asks me to use: $string =~ s/\d{2} ([\W]) \d{2} \1 \d{2}/$1-$2-$3/x instead and hence the confusion, since the special variables $1 etc will just match the pattern in parentheses, does this not mean that $1,$2,$3 should just contain the hyphen and NOT the *day*,*month*,*year* values?A related question is: if I do want to use the day,month,year values, how do I do that?
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: String Substitution Operator
by hehenoobhehe (Novice) on Oct 23, 2003 at 08:47 UTC | |
by Roger (Parson) on Oct 23, 2003 at 09:01 UTC | |
by Aragorn (Curate) on Oct 23, 2003 at 09:05 UTC |