Hey So I am not good with regex right now, trying to learn though, can someone explain this one out for me bit by bit?
if ($fileStrings[$stringCount] =~ m/((?:include|require)(?:_once)?\s*\(.*?\$.*?\);)/gi)
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
mmatch for/pattern delimiter(?:include|require)match but not capture ‘include’ or ‘require’(?:_once)?optionally match for but not capture ‘_once’\s*0 or more spaces or tabs, other “whitespace” characters(.?\$.?)match and capture 0 or 1 of any character, followed by literal $ character,followed by 0 or 1 of any character
;match for semicolon(...)outer parenthesis – capture whole thing/pattern delimitergiglobal, case-insensitive search