NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page preg_match help needed.

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 03-20-2007, 09:43 AM THREAD STARTER               #1 (permalink)
NamePros Regular
 
bliss's Avatar
Join Date: Dec 2005
Posts: 950
bliss is a name known to allbliss is a name known to allbliss is a name known to allbliss is a name known to allbliss is a name known to allbliss is a name known to allbliss is a name known to allbliss is a name known to all
 



preg_match help needed.


PHP Code:
    $match_expression '<br><span class\=a>(.*)\/<\/span><\/font>';
    
preg_match($match_expression,$total,$matches); 
    return 
strip_tags($matches[1]); 
Quote:
Warning: preg_match() [function.preg-match]: Unknown modifier '<' in /home/website/public_html/directory/myscript.php on line 21
Is giving me an error. Why? I did not think you had to escape < and > operators.
????: NamePros.com http://www.namepros.com/programming/307272-preg_match-help-needed.html


-
Last edited by bliss; 03-20-2007 at 10:03 AM.
bliss is offline  
Old 03-20-2007, 09:54 AM   #2 (permalink)
tm
Senior Member
 
tm's Avatar
Join Date: Nov 2005
Location: on a oil rig just off Ireland
Posts: 1,408
tm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of lighttm is a glorious beacon of light
 



Try this:

PHP Code:
$match_expression '/<br><span class\=a>(.*)/<\/span><\/font>/'
    
preg_match($match_expression,$total,$matches);  
    return 
strip_tags($matches[1]); 
__________________
You design in photoshop, I code into valid XHTML/CSS.
Professional PSD, PNG or HTML to tableless XHTML/CSS designs.
For more info, send me a PM.
tm is offline  
Old 03-20-2007, 10:41 AM THREAD STARTER               #3 (permalink)
NamePros Regular
 
bliss's Avatar
Join Date: Dec 2005
Posts: 950
bliss is a name known to allbliss is a name known to allbliss is a name known to allbliss is a name known to allbliss is a name known to allbliss is a name known to allbliss is a name known to allbliss is a name known to all
 



Found it. What you had was close thanks!

PHP Code:
$match_expression '/<br><span class\=a>(.*)\/<\/span><\/font>/i';
????: NamePros.com http://www.namepros.com/showthread.php?t=307272
preg_match($match_expression,$total,$matches); 
return 
strip_tags($matches[1]) 
bliss is offline  
Old 03-21-2007, 02:54 AM   #4 (permalink)
New Member
 
Dismounted's Avatar
Join Date: Jan 2007
Location: Australia
Posts: 15
Dismounted is an unknown quantity at this point
 



Remember that you have to escape the characters ^.[$()|*+?{\ (if you want to 'match' the character and not use their function) with a backslash everytime .
Dismounted is offline  
Old 03-22-2007, 07:44 AM THREAD STARTER               #5 (permalink)
NamePros Regular
 
bliss's Avatar
Join Date: Dec 2005
Posts: 950
bliss is a name known to allbliss is a name known to allbliss is a name known to allbliss is a name known to allbliss is a name known to allbliss is a name known to allbliss is a name known to allbliss is a name known to all
 



Dismounted: No, what was I missing was not one of those. It was the escape on the / and the /i at the very end, but yes that is always great to know.
Last edited by bliss; 03-22-2007 at 07:51 AM.
bliss is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:19 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger