28, May 2012

trouble with this pattern - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: trouble with this pattern
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: trouble with this pattern  (Read 1253 times)
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« on: May 06, 2007, 07:09:07 pm »

Hi,

I don't know whats wrong here, maybe you see whats the problem with this pattern:

Code:
<?php

preg_replace
('/h\ref="h\t\tp:\/\//''href="go.php?to=''<a href="http://www.domain.com">anchor</a>');

// result must be somthing like: <a href="go.php?to=www.domain.com">anchor</a>

Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #1 on: May 06, 2007, 07:19:09 pm »

shouldn't it be:
Code:
<?php

preg_replace
('/href="http:\/\//''href="go.php?to=''<a href="http://www.domain.com">anchor</a>');


Last blog : Are You Stumbling Yet?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: May 06, 2007, 07:26:27 pm »

shouldn't it be:
Code:
<?php

preg_replace
('/href="http:\/\//''href="go.php?to=''<a href="http://www.domain.com">anchor</a>');

this is what I tried first, the t and the r have also a function that why I escaped them

Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #3 on: May 06, 2007, 07:32:46 pm »

Seems to work like that on my server...


Last blog : Are You Stumbling Yet?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: May 06, 2007, 07:44:37 pm »

strange I removed the extra backslashes and its working now Huh

Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6523
Tags : regex preg_match Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: trouble with this pattern
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 10:25:01 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.