Field1: Unknown1
Field2: Unknown2
Field3: Unknown3
In my case I want to exclude row starting with “Field2:” which is effectively start marker “Field2:” end marker “\n” and replace with ” including delimiters.
Or what would be regular expression if I wanted to replace
Field2: Unknown\n with Field2: SomethingElse\n
To delete the row entirely (assuming input is a string that has all the rows delimited with
\n):To replace the row:
Since
.*grabs everything to the end of the line except the terminating line break, there’s no need to use$to match the end of the line.