]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/nickname.php
Merge branch 'readme-plugins' into 'nightly'
[quix0rs-gnu-social.git] / lib / nickname.php
index 2dd08efc3f7baeee1de2245453d3c915cde23f8b..5a5b515b4dfceec44f70c3f4b63c7e7b7285ef98 100644 (file)
@@ -76,6 +76,16 @@ class Nickname
      */
     const MAX_LEN = 64;
 
+    /**
+     * Regex with non-capturing group that matches whitespace and some
+     * characters which are allowed right before an @ or ! when mentioning
+     * other users. Like: 'This goes out to:@mmn (@chimo too) (!awwyiss).'
+     *
+     * FIXME: Make this so you can have multiple whitespace but not multiple
+     * parenthesis or something. '(((@n_n@)))' might as well be a smiley.
+     */
+    const BEFORE_MENTIONS = '(?:^|[\s\.\,\:\;\[\(]+)';
+
     /**
      * Nice simple check of whether the given string is a valid input nickname,
      * which can be normalized into an internally canonical form.