HungryMind Posted September 12, 2011 Share Posted September 12, 2011 I want to get data which is under these codes <!--load_css--> and <!--/load_css--> using preg_match() <!--load_css--><link href="../styles/style.css" rel="stylesheet" type="text/css" /><link href="../styles/style_ii.css" type="text/css" rel="alternate stylesheet" title="b-bg"/><link href="../styles/style_iii.css" type="text/css" rel="alternate stylesheet" title="c-bg"/><link href="../styles/style_iv.css" type="text/css" rel="alternate stylesheet" title="d-bg"/><link href="../styles/style_v.css" type="text/css" rel="alternate stylesheet" title="e-bg"/><link href="../styles/style_vi.css" type="text/css" rel="alternate stylesheet" title="f-bg"/><link href="../styles/style_vii.css" type="text/css" rel="alternate stylesheet" title="g-bg"/><link href="../styles/style_viii.css" type="text/css" rel="alternate stylesheet" title="h-bg"/><!--/load_css--> Need help please.Specially waiting for: the scientist, boen robot, justsomeguy replies. Link to comment Share on other sites More sharing options...
thescientist Posted September 12, 2011 Share Posted September 12, 2011 yeah, regex is definitely not my strong suit. JSG came to my rescue last time I needed some assistance on the subject. I could probably figure it out, but technically I'm on the company clock right now... Link to comment Share on other sites More sharing options...
Ingolme Posted September 12, 2011 Share Posted September 12, 2011 This should work: /<!--load_css-->(.*?)<!--\/load_css-->/g It's kind of unprofessional. with such large blocks of text I, personally, would rather make a parsing algorithm for it which doesn't involve regular expressions. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.