in reply to Re: How do I use regex to strip out specific characters in a string?
in thread How do I use regex to strip out specific characters in a string?

$stamp =~ s/\w+\s+(\d+)\/(\d+)\/\d+\s(\d+).(.*)\/$1_$2_$3$4/;

That wont even compile... youve been tripped up by your leaning toothpicks ('/\/\/\/\'). You can avoid that by changing your regex delimiter... i.e.

s|\w+\s+(\d+)/(\d+)/\d+\s(\d+).(.*)|$1_$2_$3$4|

-Blake

  • Comment on Re: Re: How do I use regex to strip out specific characters in a string?
  • Download Code