Code: Select all
preg_match("/<([a-z]*)?\>(.*?)\<\/([a-z]*)?\>/s", $str, $matches);Code: Select all
Hello World in php:
<php>
<?php
echo "Hello World";
?>
</php>
And in java:
<java>
System.out.println("Hello World");
</java>
That's basically itCurrently it will only recognize the php section though. Is there a way I can make it traverse through $str until the last occurrance instead of it only matching one regex?