Jump to content

[Solved]Cant find way to match php multi line comment block


E1M1
 Share

Recommended Posts

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

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...