Regex help needed...

Post Reply
noblestone
Posts: 154
Joined: Sun Jul 29, 2012 6:50 am

Regex help needed...

Post by noblestone »

my trigger is mocci.alt

it fires all my alt list however, i was being abused by typing hey mocci alt, it fired my list, how can I prevent that. Also when someone tested it by saying hellohowaboutmoccialt, it fired my trigger. Only need it to be specific to mocci.alt in order to fire the trigger.

my perl regex is mocci.alt

Quick response would be appreciated to reduce abuse. Thanks

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Regex help needed...

Post by Vadi »

Put ^ at the start of the pattern and $ at the end of the pattern. ^ means it only matches when it's at the start of the line, $ only matches when it's at the end of the line. That, or change it to 'exact match' in tha pattern type.

Tagon
Posts: 24
Joined: Thu Sep 19, 2013 8:38 pm

Re: Regex help needed...

Post by Tagon »


noblestone
Posts: 154
Joined: Sun Jul 29, 2012 6:50 am

Re: Regex help needed...

Post by noblestone »

I understand but ^mocci.alt$ still giving me any chars because of . in between. I want the . to be that specific char as the . itself.

Tagon
Posts: 24
Joined: Thu Sep 19, 2013 8:38 pm

Re: Regex help needed...

Post by Tagon »

Replace the "." with "\.".

It's a special character which means any character. The backslash forces it to be taken literally.

noblestone
Posts: 154
Joined: Sun Jul 29, 2012 6:50 am

Re: Regex help needed...

Post by noblestone »

Worked! Thanks

Post Reply