You are here: Using backreferences within a pattern using eregi_replace « PHP Programming Language « IT news, forums, messages
Using backreferences within a pattern using eregi_replace

Posted by Martin Lucas-Smith on 12/20/05 18:13

Is there any way to use backreferences _within_ a _pattern_, as works on
some regexp parsing applications, i.e.

'<a href="mailto:([^@]*)@([^"]*)">\\1@\\2</a>'
=>
'\\1@\\2'

so that
<a href="mailto:foo@example.com">foo@example.com</a>
WOULD match and be replaced by foo@example.com

but
<a href="mailto:foo@example.com">bar@example.com</a>
WOULD NOT match (and thus no replacement take place)

?

I can't seem to get this to work. Any suggestions for an alternative?

Martin

 

Navigation:

[Reply to this 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

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