Raised This Month: $ Target: $400
 0% 

Regex compiling error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 03-27-2014 , 21:22   Regex compiling error
Reply With Quote #1

PHP Code:
new szError[32];
if((
regex regex_compile("*HID\([a-zA-Z0-9]*)\", iRet, szError, charsmax(szError))) < REGEX_OK){
    log_amx("
REGEX ERROR: (%i) %s", iRet, szError);

Code:
22:15:47 L 03/27/2014 - 22:15:44: [test.amxx] REGEX ERROR: (20) \ at end of pattern
Why a regex could not end with \ ?

Example string:
teeestingggg*HID\helloman123\lalalala

I'm planning to run
PHP Code:
regex_match_c(inforegexiRet);
regex_substr(regex1hidcharsmax(hid)); 
So I could get "helloman123".

PS: I tried with "\\" it doesn't match.
PS2: I tried with "(?:*HID\([a-zA-Z0-9]*)\)" which is kind of workaround but I got "(3) nothing to repeat".

Finally I got the regex compiled... I forgot to escape first *
Solution: "\*HID\\([a-zA-Z0-9]*)\\"
__________________

Last edited by Neeeeeeeeeel.-; 03-28-2014 at 09:02.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-28-2014 , 05:08   Re: Regex compiling error
Reply With Quote #2

Yeah, it didn't know what character you were trying to escape (since the backslash is the escape character).
__________________
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:58.


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