Regex Match all characters between two strings

后端 未结 14 1244
星月不相逢
星月不相逢 2020-11-21 07:42

Example: \"This is just\\na simple sentence\".

I want to match every character between \"This is\" and \"sentence\". Line breaks should be ignored. I can\'t figure o

14条回答
  •  暖寄归人
    2020-11-21 08:00

    Here is how I did it:
    This was easier for me than trying to figure out the specific regex necessary.

    int indexPictureData = result.IndexOf("-PictureData:");
    int indexIdentity = result.IndexOf("-Identity:");
    string returnValue = result.Remove(indexPictureData + 13);
    returnValue = returnValue + " [bytecoderemoved] " + result.Remove(0, indexIdentity); ` 
    

提交回复
热议问题