0

I am looking to check against a line that matches the regex pattern below (emojis that are used in this format :laugh:), but I want to check if that pattern has anything before it, at the start of the line. In other words, I am trying to enforce that an emoji must be placed at the start of a line (only when there is an emoji on the line).

The regex I have already.

:[a-zA-Z0-9-_]+:

Example that must match:

  • randomstuff :laugh: or any kind of string before the emoji

It should not match:

  • :laugh:
  • :laugh: random
  • random text without emoji

I can't use any programming specific features, as this is for Reddit's AutoModerator config.

ncla
  • 714
  • 7
  • 19

0 Answers0