User:SamanthaNguyen/Regular expressions

  • Matching the names of PHP method calls: ([a-zA-Z]+)?::([a-zA-Z0-9]+)(\(\))?
  • Match some mentions of a hook in a release notes file: ([A-Za-z]+)( hook(s)?)
    This will not match every mention of a hook. only mentions where the word hook or hooks is added after, such as the "LoadExtensionSchemaUpdate hook".
  • Match configuration variables that are linked using Template:Ll: {{ll\|Manual:\$wg([A-Za-z0-9]+)\|(\$wg[A-Za-z0-9]+)}}
  • Match the name of a configuration setting: \$wg([A-Za-z0-9]+)
  • Match the name of a CVE entry: (CVE-\d+-\d+)
  • Match Hooks by file category: \[\[Category:Hooks by file(\{\{#translation:\}\})?\|([A-Za-z_]+).php\]\]
    Replace with {{MediaWiki hooks included in file|filename=$2}}
  • (\$this->getHookRunner\(\)|\$this->hookRunner|Hooks::runner\(\))->on
  • Match Packagist URLs: https://packagist.org/packages/([A-Za-z-]+)/([A-Za-z-]+)
    Replace with: {{packagist|vendor=$1|package=$2}}
  • Match updated external PHP libraries: (Updated|Added) ([a-z-]+)/([a-z-]+)
    Replace with: $1 {{packagist|vendor=$2|package=$3}}
  • Match Phabricator tasks:
    1. \(T(\d+)\)
    2. \(\[\[phab:T(\d+)\|T(\d+)\]\]\)
    Replace with: ({{PhabT|$1}})
  • Match DESCRIBE SQL command: <(code|tt)>'''DESCRIBE''' ([A-Za-z0-9_]+);</(code|tt)>