php-parser

Limitations of PEG grammar & parser generators?

I was enjoying using YARD a lot: http://www.ootl.org/yard/ http://code.google.com/p/yardparser/ http://www.codeproject.com/KB/recipes/yard-tokenizer.aspx I was able to construct fully functional calculator. I'm evaluating YARD to do PHP parser. Please kindly advise on limitations of PEG grammar & parser generators. Thank you very muc...

Is it possible to parse PHP using PEG?

The question is very straightforward: Is it possible to parse PHP using PEG? I want to use a PEG parser-generator to parse PHP. Please kindly advise. Thank you! ...

Find PHP with REGEX

I need a REGEX that can find blocks of PHP code in a file. For example: <? print '<?xml version="1.0" encoding="UTF-8"?>';?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <?php echo...

PHP- HTML parsing :: How can be taken charset value of webpage with simple html dom parser?

Hi, PHP:: How can be taken charset value of webpage with simple html dom parser (utf-8, windows-255, etc..)? remark: its have to be done with html dom parser http://simplehtmldom.sourceforge.net Example1 webpage charset input: <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> result:utf-8 Example2 webpage ch...

fetch data from elements with same id in a HTML document

I am using PHP DOMDocument class to parse the HTML file, and using the code, $dom =new DOMDocument(); @$dom->loadHTMLFile($file_path); $dom->getElementById("my_id") to fetch the data of the element with the ID "my_id", but the problem is the HTML document is containing multiple elements with same ID, and i want the data in all that el...

Should I use regex to parse this string of html table data?

What's the best way to parse this data? Should I use regex or something else? The data is in html, but I found it from a website and will be parsing this and only this string (note: string is much longer - over 1,300 instances - only two below) - note I use php & jquery for most web programming. I only need to extract the data in t...