Regex tester
Pattern
Input
//Successful
[%
  New Comment
%] other content from input

//Match: [%\r\nNew Comment\r\n%]

//Fail
[% New Comment %]

//Match: false

//Successfully match single line with
string commentPatt = @"\[%(.*)%\]";

//Match: [% New Comment %]
Options
Replacement
Click the context tab to see replacements.
4 matches found in about 2 milliseconds.
IndexPositionMatched String$1
014[%
New Comment
%]

New Comment
173[%\r\nNew Comment\r\n%]\r\nNew Comment\r\n
2108[% New Comment %] New Comment
3210[%(.*)%\]";

//Match: [% New Comment %]
(.*)%\]";

//Match: [% New Comment
//Successful
​[%
​  New Comment
​%] other content from input
​
​//Match: [%\r\nNew Comment\r\n%]
​
​//Fail
​[% New Comment %]
​
​//Match: false
​
​//Successfully match single line with
​string commentPatt = @"\[%(.*)%\]";
​
​//Match: [% New Comment %]
  1. //Successful

  2. New Comment
  3. other content from input

    //Match:
  4. \r\nNew Comment\r\n


  5. //Fail
  6. New Comment


  7. //Match: false

    //Successfully match single line with
    string commentPatt = @"\
  8. (.*)%\]";

    //Match: [% New Comment
  9. empty string