On 18/03/2016 15:20, jameshale wrote:
I have large bodies of xhtml/html text stored in an array which I would like
to clean up using GREP.
I have been using the 'replacetext' function to great effect but I have hit
an impasse.
There are some situations where I think I really need to use back references
but LC's GREP does not allow them.
Hi James,
Unfortunately XHTML and HTML are not regular languages, which means that
they cannot be processed correctly with regular expressions.
Indeed, "Implement an HTML parser using regular expressions" is a
well-known prank project to suggest for inexperienced developers to
waste their time on...
So, your approach is sadly not workable.
If you're processing XHTML, I recommend using revXML.
If you need to process arbitrary HTML, then unfortunately the only
sensible option is to use a browser...
Peter
--
Dr Peter Brett <peter.br...@livecode.com>
LiveCode Open Source Team
LiveCode 2016 Conference: https://livecode.com/edinburgh-2016/
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode