title: TS stating that test() is not a property on a string?
body: <p>I have a simple <strong>RegEx</strong> pattern test that I'd like to run on a string; you can see this in the example below as the variable <code>part</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/qfgeQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qfgeQ.png" alt="part is a string"></a></p>
  
  <p>When I do this, however, the red-squiggly line is indicating the error of:</p>
  
  <blockquote>
    <p>Property 'test' does not exist on type 'string'.ts(2339)</p>
  </blockquote>
  
  <p>I am using TS 3.2.2 and my <code>tsconfig.json</code> is rather unexciting:</p>
  
  <pre><code>{
    "compilerOptions": {
      "declaration": true,
      "module": "commonjs",
      "moduleResolution": "node",
      "target": "es2017",
      "noImplicitAny": true,
      "outDir": "./lib",
      "preserveConstEnums": true,
      "removeComments": true,
      "typeRoots": ["./node_modules/@types"]
    },
    "include": ["src/**/*.ts"],
    "exclude": ["node_modules", "**/*-spec.ts"]
  }
  </code></pre>
  
  <p>Can anyone help me understand this? Clearly <code>test</code> IS a property on string!</p>