title: How to write a Reg Expression of a string that contains two tilde ~ , or two underscore
body: <p>Asterisk is working well. But I haven't figured out how to write an expression for underscore and tilde... I have tried multiple combinations. Please ignore what you see on the code below.</p>
  <pre><code>   else if (message.text.contains(&quot;_&quot;)) {
          message.text.trim().splitMapJoin(RegExp(r'/_(._?)_/'), onMatch: (m) {
            textParts.add(TextSpan(
                text: m.group(1), style: TextStyle(fontStyle: FontStyle.italic)));
            return '';
          }, onNonMatch: (String text) {
            textParts.add(TextSpan(text: text));
            return ' ';
          });
        } 
  
         else if (message.text.contains(&quot;*&quot;)) {
          message.text.trim().splitMapJoin(RegExp(r'\*(.*?)\*'), onMatch: (m) {
            textParts.add(TextSpan(
                text: m.group(1), style: TextStyle(fontWeight: FontWeight.bold)));
            return '';
          }, onNonMatch: (String text) {
            textParts.add(TextSpan(text: text));
            return ' ';
          });
        } 
  
        else if (message.text.contains(&quot;~&quot;)) {
          message.text.trim().splitMapJoin(RegExp(r'\~(.~?)\~'), onMatch: (m) {
            textParts.add(TextSpan(
                text: m.group(1), style: TextStyle(decoration: TextDecoration.lineThrough)));
            return '';
          }, onNonMatch: (String text) {
            textParts.add(TextSpan(text: text));
            return ' ';
          });
        } 
  </code></pre>