Jump to content

[SOLVED] Regex with a "Degree" character?


gary_rip

Recommended Posts

Hey All... a little help needed if you will?

 

This is the code that i am scraping from a site.

 

		<li>1455°
		<a style="position:relative; display:inline;"
	<li>795°
		<a style="position:relative; display:inline;" 
	<li>59°
		<a style="position:relative; display:inline;" 
	<li>49°
		<a style="position:relative; display:inline;" 
	<li>4°
		<a style="position:relative; display:inline;" 

 

I would like to take just the number.

 

Ive been using this code...

 

<?php
$regex = '/<li>(.+?)$/i';
preg_match_all($regex,$data,$match4);
?>

 

Which i have tested on http://www.rubular.com/ and it seems it should work, but in practice it does not.

 

Any suggestions?

 

EDIT: Here is a perma link to Rubular with info filled in... http://www.rubular.com/regexes/6315

Link to comment
https://forums.phpfreaks.com/topic/146851-solved-regex-with-a-degree-character/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.