I want to search and replace substring in string which starts and ends with special character.
string myString = "FIELD COMPARRISON SAME ROWîSTLîTHEATRE_CASEîCLIENT_IDî==î*EMERGENCY_CLINICAL_PRIORITY_LOCAL_CODE*í";
** I want to replace *EMERGENCY_CLINICAL_PRIORITY_LOCAL_CODE* with some other value **
Edit: Sorry my fault.
I want to replace EMERGENCY_CLINICAL_PRIORITY_LOCAL_CODE with some other value.
currently am using IndexOf to find first and second instance of * and then get the string with above indexes. How this can be achieved in RegEx?
By the way, if marker ever changes, you may need to use
Regex.Escape(marker)instead ofmarkerin the string.Format.