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 other)

Re: [PHP] Unexplained Issue Using Regex

2009-03-07 Thread 9el
On Sat, Mar 7, 2009 at 2:37 PM, Jochem Maas joc...@iamjochem.com 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

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 le...@phpxperts.net wrote: On Sat, Mar 7, 2009 at 2:37 PM, Jochem Maas

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 --

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 le...@phpxperts.net wrote: --- Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get a Free CD of Ubuntu mailed to your door

Re: [PHP] Unexplained Issue Using Regex

2009-03-07 Thread 9el
On Sat, Mar 7, 2009 at 4:10 PM, Nitsan Bin-Nun nit...@binnun.co.il 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

Re: [PHP] Unexplained Issue Using Regex

2009-03-06 Thread Adam
would this not work? : ?php $string = 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

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 adiszak...@gmail.com wrote: would this not work? : ?php $string =

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 other)

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 correspondence

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

Re: [PHP] Unexplained Issue Using Regex

2009-03-06 Thread haliphax
On Fri, Mar 6, 2009 at 3:44 PM, Nitsan Bin-Nun nit...@binnun.co.il 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

Re: [PHP] Unexplained Issue Using Regex

2009-03-06 Thread haliphax
On Fri, Mar 6, 2009 at 3:53 PM, haliphax halip...@gmail.com wrote: On Fri, Mar 6, 2009 at 3:44 PM, Nitsan Bin-Nun nit...@binnun.co.il 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

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/541070871c7a8d9chttp://www.zshare.net/video/541070871c7a8d9c '; That's why I used (www\.|), but I'm not a regex expert and

Re: [PHP] Unexplained Issue Using Regex

2009-03-06 Thread haliphax
On Fri, Mar 6, 2009 at 4:01 PM, Nitsan Bin-Nun nit...@binnun.co.il wrote: On Fri, Mar 6, 2009 at 11:53 PM, haliphax halip...@gmail.com wrote: On Fri, Mar 6, 2009 at 3:44 PM, Nitsan Bin-Nun nit...@binnun.co.il wrote: I'm not looking for other ideas, the main thing here is that I have about

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 halip...@gmail.com wrote: On Fri, Mar 6, 2009 at 4:01 PM, Nitsan Bin-Nun nit...@binnun.co.il wrote: On Fri, Mar 6, 2009 at