I think this will do what you're asking, but I can't test it.
$line =~ s/In:(.*)Your/In:($newstring)Your/; # substitute In: followed by any number of anything followed by Your # with In: followed by $newstring followed by Your -----Original Message----- From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 07, 2002 2:55 PM To: [EMAIL PROTECTED] Subject: Finding words between words... Hey all, Does any one know how I would go about finding everything between the words of... In: <AND> Your? So if I have a sentance with the following... Hello all this In: America (New York) Your So is there some perl code that will extract America (New York). Keep in mind tha t everything between In: <AND> Your will change. Thx, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -------------------------------------------------------------------------------- This email may contain confidential and privileged material for the sole use of the intended recipient. If you are not the intended recipient, please contact the sender and delete all copies. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]