Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Make function to extract hashtags public #9

Closed
SchnMar opened this issue Jun 23, 2020 · 3 comments
Closed

[Feature Request] Make function to extract hashtags public #9

SchnMar opened this issue Jun 23, 2020 · 3 comments

Comments

@SchnMar
Copy link
Contributor

SchnMar commented Jun 23, 2020

Hey,

it would be nice to have the same function available which is used to extract hash tags in the package so some additional logic can be implemented in regard of the hashtags.

Thank you!

@SchnMar
Copy link
Contributor Author

SchnMar commented Jun 23, 2020

Something like this. Maybe missing the emoji part.

var hashTagRegExp = RegExp(
      "(?!\\n)(?:^|\\s)(#([·・ー_ぁ-んァ-ンa-zA-Z0-9一-龠0-9a-zA-ZáàãâéêíóôõúüçÁÀÃÂÉÊÍÓÔÕÚÜÇ]+))",
      multiLine: true,
    );
    final tags = hashTagRegExp.allMatches(text).toList();
    List<String> hashtags = List<String>();

    for (var tag in tags) {
      hashtags.add(
       test.substring(tag.start, tag.end),
      );
    }

Thank you

@santa112358
Copy link
Owner

I just updated the package and I added some functions : bool hasHashTags(String value) and List<String> extractHashtags(String value). If they aren't what you have expected, please reopen this issue.

@santa112358
Copy link
Owner

I forgot to mention you @SchnMar . Thank you for the request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants