Hello all, I would like to replace a word(s) in my string only if it's/they're between two predefined characters and if the string contains a certain word. For example suppose I have the following string:
*ID:123456; FirstName: John; LastName: Smith; Occupation:Doctor; Address: New York, NY, USA; Contact:jsmith@website.com; Phone:111-111-1111; Job Descriptions:Care for patients in New York, NY, USA; *ID:789221; FirstName: Jane; LastName: Doe; Occupation:Lawyer; Address: New York, NY, USA;Contact:jdoelawoffice@website.com; Phone:555-555-5555; Job Descriptions:Represents clients in New York, NY, USA;
I would like to change the Address from New York, NY, USA to Chicago, IL, USA in the Job Description, only if ID is 12345. How would I go about doing that using Regex? Thanks in advance for your help.
Go to the complete details ...