Jump to content

Preg_Match Issue


HungryMind

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...