Jump to content

Recommended Posts

Posted (edited)

After over half hour puzzling I cant find way to match multi line comment in php. My code ($commentblock) works fine with single line block comment but CRLF breaks it. Could anyone tell me how I could fix it?

Comment example:

/*blah

blah

blah*/

#include <array.au3>
FileGetFunctionCallTips("funcs.php")
Func FileGetFunctionCallTips($file)
    $contents = FileRead($file)
    $quote = '"'
    $function = "rnfunctionh+w+(?:s|s?)((?:[ a-zA-Z0-9.,$'"&$quote&"=]+|[ a-zA-Z0-9.,$'"&$quote&"=])?)"
    $singlelinecomment =  "rn//(?:.)+"
    $commentblock =  "rn/*(?:.*|rn)*/"
    $matches = StringRegExp ( $contents, $commentblock  ,3)
    _ArrayDisplay($matches)
EndFunc

Thanks in advance.

From Internet i foun"rn/*[^*]**+(?:[^*/][^*]**+)*/" but i dont get it why my original algorithm didn't work.

Edited by E1M1

edited

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...