protected static AliasCandidate getAliasAt(String input, int start) {
    if (input.length() < start + 2 || input.charAt(start) != ':') return null; // Aliases start with :
    int aliasEnd = input.indexOf(':', start + 2);  // Alias must be at least 1 char in length
    if (aliasEnd == -1) return null; // No alias end found

    int fitzpatrickStart = input.indexOf('|', start + 2);
    if (fitzpatrickStart != -1 && fitzpatrickStart < aliasEnd) {
      Emoji emoji = EmojiManager.getForAlias(input.substring(start, fitzpatrickStart));
      if (emoji == null) return null; // Not a valid alias
      if (!emoji.supportsFitzpatrick()) return null; // Fitzpatrick was specified, but the emoji does not support it
      Fitzpatrick fitzpatrick = Fitzpatrick.fitzpatrickFromType(input.substring(fitzpatrickStart + 1, aliasEnd));
      return new AliasCandidate(emoji, fitzpatrick, start, aliasEnd);
    }

    Emoji emoji = EmojiManager.getForAlias(input.substring(start, aliasEnd));
    if (emoji == null) return null; // Not a valid alias
    return new AliasCandidate(emoji, null, start, aliasEnd);
  }
Finds the alias in the given string starting at the given point, null otherwise
src/main/java/com/vdurmont/emoji/EmojiParser.java