Skip to content

Instantly share code, notes, and snippets.

@Blasanka
Created January 23, 2020 02:14
Show Gist options
  • Select an option

  • Save Blasanka/15bf38fbd0dd20d72b407434b9b013e7 to your computer and use it in GitHub Desktop.

Select an option

Save Blasanka/15bf38fbd0dd20d72b407434b9b013e7 to your computer and use it in GitHub Desktop.

Revisions

  1. Blasanka created this gist Jan 23, 2020.
    13 changes: 13 additions & 0 deletions replash_hash_tag_url.dart
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    void main() {
    String text = "Test #/first1hashtag test #/second2hashtag test.";
    RegExp exp = new RegExp(r"\B#\/");
    exp.allMatches(text).forEach((match){
    print(match.group(0));
    text = text.replaceAll(match.group(0), "");
    });
    print(text);

    String text2 = "Test #/first1hashtag test #/second2hashtag test.";
    text2 = text2.replaceAll("#/", "");
    print(text2);
    }