Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

mikeytown2’s picture

regex to match on a function
'/\\s*function\\s+((?:[a-z][a-z0-9_]*))\\s*\\(.*\\)\\s*\\{/smix'
crude but should get the job done.

  $pattern = '/\\s*function\\s+((?:[a-z][a-z0-9_]*))\\s*\\(.*\\)\\s*\\{/smix';
  $matches = array();
  preg_match($pattern, $input, $matches);

  // Output function name.
  echo $matches[1];

The alternative is to special case this as most function definitions are done in a .js file. I might end up doing both.

mikeytown2’s picture

Status: Active » Fixed
FileSize
1.12 KB

  • mikeytown2 committed 9611248 on 7.x-2.x
    Issue #2500803 by mikeytown2: Do not inline defer loadCSS.
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.