Reply to Re: [PHP] Regexp help second

Your name:

Reply:


Posted by Richard Lynch on 01/06/05 18:29

You could maybe cheat and add an X at the beginning and end of the string
before your Regex, then you will have:

X\1 \2 \3X

and you can strip off the initial X from \1 and the trailing X from \3

There's probably some fancy Regexp way to do it though.

Uroš Gruber wrote:
> Hi!
>
> Last help about regexp solve my problem, but I have another one.
>
> I've made some regexp but it does not work always
>
> Let say I have some strings
>
> 1) this is some domain.com test
> 2) domain.com
>
> I can make this work either for first example of fo second, but not for
> both. What I want is replace of domain.com to get
>
> this is dome domain.com domain com test so replace should be
> \1 \2 \3
>
> so for second example I did /((.+)\.{1}(.+))/
>
> How can I extend this to work in both.
>
> regards
>
> Uros
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Like Music?
http://l-i-e.com/artists.htm

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация