regexp_match problem
I have the following pattern:
Code:
"^"BANNED^" ^"is banned on ([^^:]*): (.*)^"$"Code:
"BANNED" "is banned on Betreutes Zocken: "idiot""Code:
"BANNED" "is banned on ([^:]*): (.*)"$Code:
"^"BANNED^" ^"is banned on ([^^:]*): ([^^^"]*)^""I'm also calling the regexp_match() function with the "m" flag. |
Re: regexp_match problem
In AMXX, ^ is the escape character. If you want to include it in a string, you have to use ^^, similar to how you would use \\ for \ in C.
|
Re: regexp_match problem
Look at my first pattern, its already AMXX escaped, but it looks like the $ sign does not act like it should.
This is my unescaped regex pattern: Code:
"BANNED" "is banned on ([^:]*): (.*)"$AMXX escaped this looks like this: Code:
"^"BANNED^" ^"is banned on ([^^:]*): (.*)^"$"Code:
"BANNED" "is banned on Zechhalle Hamburg: VAC ban(s) on record" |
Re: regexp_match problem
"BANNED" "is banned on ([^:]+): (.+)"
Works on all different test data you provided. Code:
] regex_pattern ""BANNED" "is banned on ([^:]+): (.+)"" |
Re: regexp_match problem
Thanks, I solved the problem now by a bit trial and error, but I have forgotten to mention that my string looks more like this:
Code:
"BANNED" "is banned on Betreutes Zocken: Verdacht auf Cheat/ Multiacc."\rCode:
"^"BANNED^" ^"is banned on ([^^:]+): ([^^^r]+)^"^r" |
Re: regexp_match problem
Use something like this:
PHP Code:
|
Re: regexp_match problem
Yes, I'm using this method, but this extracts only the matches of the first line, and not all the matches in my string, which contains multiple occurences(lines) of this pattern.
|
Re: regexp_match problem
You'll probably have to break it up.
|
Re: regexp_match problem
Ok, thanks.
|
Re: regexp_match problem
It depends on how you get the data. If using file operations (fopen, fget, etc) then you would parse them line by line in the loop anyways and you do your regex there.
|
| All times are GMT -4. The time now is 23:28. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.