1

I am trying to do function matching in the .plist file and am running into a problem. I want to match two very different types of 'functions' and I'm not sure if it's possible.

function fooBar() { .. }

fooBar = function() { .. }

The issue seems to be two named subpatterns. BBEdit needs the names to fill out the function list, but I can't use the same subpattern name twice.

Is this even possible?

Here is my somewhat simplified pattern matching...

    <key>Function Pattern</key>
    <string><![CDATA[
    (?x:
        (^[ \t]+(?P<function_name>[a-zA-Z0-9_]+)[ \t]*=[ \t]*function[ \t]*\() |
        (^[ \t]+function(?P<function_name>[a-zA-Z0-9_]+)[ \t]*\()

    )
    ]]> </string>
Roger Gilbrat
  • 3,755
  • 5
  • 34
  • 58

0 Answers0