added t tag to messages with #tags

This commit is contained in:
Vishal
2022-12-05 11:57:34 +05:30
parent 4f8a138fd0
commit 6d5cbde5f4
6 changed files with 44 additions and 45 deletions

View File

@@ -19,6 +19,22 @@ String getPostKindFrom(enumRoomType eType) {
}
Set<String>? getTagsFromContent(String content) {
Set<String>? tags = null;
String regexp1 = '(#[a-zA-Z0-9_\-]+ )|(#[a-zA-Z0-9_\-]+)\$';
RegExp httpRegExp = RegExp(regexp1);
for( var match in httpRegExp.allMatches(content) ) {
if( tags == null)
tags = {};
tags.add( content.substring(match.start + 1, match.end) );
}
return tags;
}
class HistogramEntry {
String str;
int count;