AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   regex pattern (https://forums.alliedmods.net/showthread.php?t=132724)

iMack 07-18-2010 09:39

regex pattern
 
what is bad in this pattern for regex_match
Code:

(.*)(\^\!\°\`\;\%\§)(.*)

fysiks 07-18-2010 12:30

Re: regex pattern
 
What are you trying to match? And what are you trying to retrieve as substrings? Show some examples. I'm going to assume that you are using parentheses when you whould use brackets.

iMack 07-18-2010 12:51

Re: regex pattern
 
i'm trying to match these "!, $, %, ^, &, §, ', ;" characters in player name.

fysiks 07-18-2010 12:59

Re: regex pattern
 
Quote:

Originally Posted by iMack (Post 1243441)
i'm trying to match these "!, $, %, ^, &, §, ', ;" characters in player name.

yeah, but what are you trying to do with it? Do you need the string before and after that character? If you are just tring to find if the name contains one of those characters then you probably don't need regex.

iMack 07-18-2010 13:24

Re: regex pattern
 
i want only find that character in name... i tried to use contain function, but
"if ( contain( name, "^") != -1)" wrote invalid symbol in compliling

fysiks 07-18-2010 13:46

Re: regex pattern
 
Quote:

Originally Posted by iMack (Post 1243478)
i want only find that character in name... i tried to use contain function, but
"if ( contain( name, "^") != -1)" wrote invalid symbol in compliling

Use "^^" for the ^ character.

iMack 07-18-2010 14:04

Re: regex pattern
 
ok thx


All times are GMT -4. The time now is 07:04.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.