[Bug?][Regex] Comparing '/' (slash)

This place is for Closed bug reports only. NOT for asking help!

Moderators: Moderators, Developers

Message
Author
Schwarzschild
Noob
Noob
Posts: 6
Joined: 28 Jul 2011, 02:30
Noob?: Yes

[Bug?][Regex] Comparing '/' (slash)

#1 Post by Schwarzschild »

I have a problem when comparing a string which contains '/' (slash) character.
here the regex example :

Code: Select all

console /^(.*?): '(.+)'\/'(.+)'\/(.+)$/i
it's only matching the strings until it finds "/", it doesn't care whether the "/" is the last one or not.

the problem seems to be caused by Utilities.pm, especially on this code :

Code: Select all

	if ($kw =~ [color=#FF0000]/^\/(.*?)\/(\w?)/[/color] ){
		if ($text =~ /$1/ || ($2 eq 'i' && $text =~ /$1/i)) {
.
.
.
ok, im not good at regex, but, can i use

Code: Select all

/\/((.*?)\/*(.*?))*\/(\w?)
instead of

Code: Select all

/^\/(.*?)\/(\w?)/
do you have another solution/suggestion?

Thank you :roll:

edit :
i found that characters can be represented by octal and hexadecimal, so we can replace "/" with \057 (octal) XD.

but, can we fix that things? :?

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: [Bug?][Regex] Comparing '/' (slash)

#2 Post by EternalHarvest »

Fixed.

Schwarzschild
Noob
Noob
Posts: 6
Joined: 28 Jul 2011, 02:30
Noob?: Yes

Re: [Bug?][Regex] Comparing '/' (slash)

#3 Post by Schwarzschild »

many thanks for you EternalHarvest :D sorry for placing this thread in the wrong forum :roll: i thought bugs report forum was only for main openkore problems/bugs :oops:

Post Reply