Re: [PHP] Unexplained Issue Using Regex

2009-03-07 Thread 9el
On Sat, Mar 7, 2009 at 4:10 PM, Nitsan Bin-Nun wrote: > Yes you can ;) > > and I'm using ubuntu :P > There's a fun joke in My Mothertongue Bangla (5th most spoken in the world by about 300million). "Anis dis na" = "Take but never giveaway" Anis is a common arabic name but in Bangla Anis me

Re: [PHP] Unexplained Issue Using Regex

2009-03-07 Thread Nitsan Bin-Nun
Yes you can ;) and I'm using ubuntu :P On Sat, Mar 7, 2009 at 12:08 PM, 9el wrote: > > --- > Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get > a Free CD of Ubuntu mailed to your door without any cost. Vis

Re: [PHP] Unexplained Issue Using Regex

2009-03-07 Thread 9el
--- Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get a Free CD of Ubuntu mailed to your door without any cost. Visit : www.ubuntu.com -- On

Re: [PHP] Unexplained Issue Using Regex

2009-03-07 Thread Nitsan Bin-Nun
There is no reason to share the code because it happens with almost ALL the regex's I'm using :( But I worked this out using Todd's solution. Thank you all for trying to help. On Sat, Mar 7, 2009 at 11:06 AM, 9el wrote: > > On Sat, Mar 7, 2009 at 2:37 PM, Jochem Maas wrote: > >> Nitsan Bin-Nu

Re: [PHP] Unexplained Issue Using Regex

2009-03-07 Thread 9el
On Sat, Mar 7, 2009 at 2:37 PM, Jochem Maas wrote: > Nitsan Bin-Nun schreef: > > Hi lista, > > > > I have been trying to figure this out for the last couple of hours but > I'm > > lack of luck. > > Take a look at these regex's, the string that was inputed into the > > preg_replace (using Uis modi

Re: [PHP] Unexplained Issue Using Regex

2009-03-07 Thread Jochem Maas
Nitsan Bin-Nun schreef: > Hi lista, > > I have been trying to figure this out for the last couple of hours but I'm > lack of luck. > Take a look at these regex's, the string that was inputed into the > preg_replace (using Uis modificators) and the results: > (the lists have correspondence to each

Re: [PHP] Unexplained Issue Using Regex

2009-03-06 Thread Nitsan Bin-Nun
Got it, thank you Todd. I usually tend to use string based functions instead of regex, but sometimes regex is a better option. On Sat, Mar 7, 2009 at 12:16 AM, haliphax wrote: > On Fri, Mar 6, 2009 at 4:01 PM, Nitsan Bin-Nun > wrote: > > On Fri, Mar 6, 2009 at 11:53 PM, haliphax wrote: > >> >

Re: [PHP] Unexplained Issue Using Regex

2009-03-06 Thread haliphax
On Fri, Mar 6, 2009 at 4:01 PM, Nitsan Bin-Nun wrote: > On Fri, Mar 6, 2009 at 11:53 PM, haliphax wrote: >> >> On Fri, Mar 6, 2009 at 3:44 PM, Nitsan Bin-Nun >> wrote: >> > I'm not looking for other ideas, the main thing here is that I have >> > about >> > 30-100 regex's in the database and the

Re: [PHP] Unexplained Issue Using Regex

2009-03-06 Thread Nitsan Bin-Nun
Thank you Todd, I also want to capture when I don't have the www in the beginning of the URL. For instance, try to execute your code with $orig = 'http://zshare.net/video/541070871c7a8d9c '; That's why I used (www\.|), but I'm not a regex expert and I

Re: [PHP] Unexplained Issue Using Regex

2009-03-06 Thread haliphax
On Fri, Mar 6, 2009 at 3:53 PM, haliphax wrote: > On Fri, Mar 6, 2009 at 3:44 PM, Nitsan Bin-Nun wrote: >> I'm not looking for other ideas, the main thing here is that I have about >> 30-100 regex's in the database and the script fetches them and applies them >> to the string. I can't build again

Re: [PHP] Unexplained Issue Using Regex

2009-03-06 Thread haliphax
On Fri, Mar 6, 2009 at 3:44 PM, Nitsan Bin-Nun wrote: > I'm not looking for other ideas, the main thing here is that I have about > 30-100 regex's in the database and the script fetches them and applies them > to the string. I can't build again the engine and I'm not going to do that. > I'm trying

Re: [PHP] Unexplained Issue Using Regex

2009-03-06 Thread Nitsan Bin-Nun
I'm not looking for other ideas, the main thing here is that I have about 30-100 regex's in the database and the script fetches them and applies them to the string. I can't build again the engine and I'm not going to do that. I'm trying to solve my problem ;) If you have any ideas regarding my issu

Re: [PHP] Unexplained Issue Using Regex

2009-03-06 Thread Jim Lucas
Jim Lucas wrote: > Nitsan Bin-Nun wrote: >> Hi lista, >> >> I have been trying to figure this out for the last couple of hours but I'm >> lack of luck. >> Take a look at these regex's, the string that was inputed into the >> preg_replace (using Uis modificators) and the results: >> (the lists have

Re: [PHP] Unexplained Issue Using Regex

2009-03-06 Thread Jim Lucas
Nitsan Bin-Nun wrote: > Hi lista, > > I have been trying to figure this out for the last couple of hours but I'm > lack of luck. > Take a look at these regex's, the string that was inputed into the > preg_replace (using Uis modificators) and the results: > (the lists have correspondence to each ot

Re: [PHP] Unexplained Issue Using Regex

2009-03-06 Thread Nitsan Bin-Nun
Haven't tested your code but from a rapid look it would work. The issue here is that I don't understand why my expression doesn't catches the full match and emits the first character? On Fri, Mar 6, 2009 at 10:17 PM, Adam wrote: > would this not work? : > > > $string = "http://www.zshare.net/v

Re: [PHP] Unexplained Issue Using Regex

2009-03-06 Thread Adam
would this not work? : http://www.zshare.net/video/541070871c7a8d9c";; $replaceWithThis = 'HELLYES-'; echo $string."\n"; echo preg_replace('/\S+video\//',$replaceWithThis,$string)."\n"; echo $replaceWithThis.substr($string, strripos($string, '/')+1, strlen($string))."\n"; echo $replaceWithThis.su