Jump to content

pcrecpp syntax is unclear


myonlake

Recommended Posts

Hey,

The pcrecpp library MTA uses for regular expressions is unknown to me. The syntax is for whatever reason different from what PHP and JavaScript uses, even though as far as I know PHP uses the exact same library?

Can someone lend me a hand figuring out the right syntax for this, as it seems this gives zero results when using pregFind/match.

^[^local ]function (.*?)\( 

Flags: mi

Everywhere else:

/^[^local ]function (.*?)\(/gmi 

local function testing1( ) 
  
end 
  
function testing2( ) -- matches on regex101, but not via MTA's pregs 
  
end 
  
addEventHandler( "test", 
    function( ) 
        
    end 
) 

To those who don't know what this is, don't bother replying.

MTA devs didn't know anything on irc today, so hoping someone knows here...

Edited by Guest
Link to comment

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
  • Recently Browsing   0 members

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