Search code examples
phpregexnotepad++

Regexp to search for strings like 'cpt' => on Notepad++


I'm trying to build a list of array of mime types for PHP. I got a long list of mime types but I need to remove all the 'xxx' => upfront. How to detect them using regexp cos I tried '[\u][a-z0-9]' => and it didn't work.

    'cpt' => 'application/mac-compactpro',
    'cpt' => 'application/x-compactpro',
    'cpt' => 'application/x-cpt',
    'crl' => 'application/pkcs-crl',
    'crl' => 'application/pkix-crl',
    'crt' => 'application/pkix-cert',
    'crt' => 'application/x-x509-ca-cert',
    'crt' => 'application/x-x509-user-cert',
    'csh' => 'application/x-csh',
    'csh' => 'text/x-script.csh',
    'css' => 'application/x-pointplus',

Solution

  • Try this .... Find:^\s*'\w+' =>
    Replace with:empty

    enter image description here