|
| 25 Jul 2013 08:25 PM |
I'm trying to use file_get_contents and preg_match to get info from roblox such as userblurb, but I don't know how to use preg_match.
Can anyone inform me on how to use preg_match? |
|
|
| Report Abuse |
|
|
coolbob44
|
  |
| Joined: 26 Nov 2009 |
| Total Posts: 1649 |
|
|
| 25 Jul 2013 08:32 PM |
| Don't use regex to navigate HTML. Load it as a DOMDocument or SimpleXMLElement |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2013 08:35 PM |
| I don't know anything about DOMDocument or SimpleXMLElement |
|
|
| Report Abuse |
|
|
coolbob44
|
  |
| Joined: 26 Nov 2009 |
| Total Posts: 1649 |
|
| |
|
Charl3s7
|
  |
| Joined: 07 Dec 2007 |
| Total Posts: 4146 |
|
|
| 26 Jul 2013 03:06 AM |
| Use cURL and parse it yourself. |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 26 Jul 2013 05:21 AM |
pfft
use LAU
LuacURL and luaXML
c: |
|
|
| Report Abuse |
|
|
Charl3s7
|
  |
| Joined: 07 Dec 2007 |
| Total Posts: 4146 |
|
| |
|
Garnished
|
  |
| Joined: 09 Apr 2012 |
| Total Posts: 12695 |
|
| |
|
Maradar
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 4478 |
|
|
| 27 Jul 2013 09:32 PM |
If he told us what programming language it was in, it'd be easier.
~Tanner L. Ghosen~ |
|
|
| Report Abuse |
|
|
coolbob44
|
  |
| Joined: 26 Nov 2009 |
| Total Posts: 1649 |
|
|
| 27 Jul 2013 09:37 PM |
| The functions he listed in the subject are in PHP. Therefore, we can assume that he is using PHP. |
|
|
| Report Abuse |
|
|
Maradar
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 4478 |
|
|
| 27 Jul 2013 09:38 PM |
ok. int preg_match ( string $pattern , string $subject [, array &$matches [, int $flags = 0 [, int $offset = 0 ]]] ) Searches subject for a match to the regular expression given in pattern. ~Tanner L. Ghosen~ |
|
|
| Report Abuse |
|
|
coolbob44
|
  |
| Joined: 26 Nov 2009 |
| Total Posts: 1649 |
|
|
| 27 Jul 2013 09:40 PM |
| No, he should't use preg_match. Regular expressions should not be used to parse HTML. |
|
|
| Report Abuse |
|
|
Maradar
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 4478 |
|
|
| 27 Jul 2013 09:41 PM |
@coolbob44 which is why I posted the preg_match, to show him he's not using a right method. i should have mentioned that, though. ~Tanner L. Ghosen~ |
|
|
| Report Abuse |
|
|
coolbob44
|
  |
| Joined: 26 Nov 2009 |
| Total Posts: 1649 |
|
|
| 27 Jul 2013 09:45 PM |
| I literally answered this post yesterday. I told him that in the first reply. Why do you feel the need to repeat exactly what I already said? |
|
|
| Report Abuse |
|
|
Maradar
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 4478 |
|
|
| 27 Jul 2013 09:48 PM |
@coolbob44 Likely because I didn't read the dates of the posts. Plus, I didn't read any of the posts except for OP's.
~Tanner L. Ghosen~ |
|
|
| Report Abuse |
|
|
1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 27 Jul 2013 09:58 PM |
using regular expressions to parse html? ew use jquery |
|
|
| Report Abuse |
|
|
coolbob44
|
  |
| Joined: 26 Nov 2009 |
| Total Posts: 1649 |
|
|
| 27 Jul 2013 10:00 PM |
| You can't use jQuery to parse HTML when you're using PHP. Jesus, people.. |
|
|
| Report Abuse |
|
|
| |
|