Link to home
Start Free TrialLog in
Avatar of philsivyer
philsivyer

asked on

Inserting text before and after regex

Hello
I want to inset text before and after a date - example.

str5="Royal coronation year and dob is 1952/12/14 - great year. Another
good year was 1966/01/01"
puts str5.match(/\b(\d\d\d\d)\/(\d\d)\/(\d\d)/)

So, what I would like is to put say "YEAR" before and "END" after each date found
in the given format. So, the final result would be...

"Royal coronation year and dob is YEAR 1952/12/14 END- great year. Another
good year was YEAR 1966/01/01 END"
Regards
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of philsivyer
philsivyer

ASKER

Thanks
Welcome back - where have you been?
busy
and spending the little time I had left for Experts Exchange in teh XSLT zone
I am happy that you missed me :-)
Now I know where you are - thanks!