0

I have a regex to find something like /someChars1@someChars2BOT in java

rules:

  1. the text has to start with / symbol

  2. someChars1 should contain at least 1 char or more (it could not be whiteSpace)

  3. someChars2 has to start with @ symbol and it could not be whitespace

  4. the text has to end with BOT word

  5. the text could not contain whitespace

can someone help me? thank you in advance

seenukarthi
  • 8,241
  • 10
  • 47
  • 68
lia
  • 193
  • 2
  • 2
  • 12

1 Answers1

0

You may try with this:

\/[\S]+@[\S]+BOT

Explanation:

  1. \/ Start with /
  2. [\S]+ matches any non white space character where + means one or more
  3. @ followed by @
  4. [\S]+ matches any non white space character where + means one or more
  5. BOT matches BOT

Example

Mustofa Rizwan
  • 10,215
  • 2
  • 28
  • 43