I got an unexpected internal NPE when playing with this script.

```
POST _scripts/painless/_execute
{
  "script": {
    "source": """
    return /[^\w]+/.split('abc   def higkln').toArray(String[]::new)
    """
  }
}
```
```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "script_exception",
        "reason" : "compile error",
        "script_stack" : [ ],
        "script" : "\n    return /[^\\w]+/.split('abc   def higkln').toArray(String[]::new)\n    ",
        "lang" : "painless"
      }
    ],
    "type" : "script_exception",
    "reason" : "compile error",
    "script_stack" : [ ],
    "script" : "\n    return /[^\\w]+/.split('abc   def higkln').toArray(String[]::new)\n    ",
    "lang" : "painless",
    "caused_by" : {
      "type" : "null_pointer_exception",
      "reason" : "Cannot read field \"annotations\" because the return value of \"org.elasticsearch.painless.lookup.PainlessLookup.lookupPainlessClass(java.lang.Class)\" is null"
    }
  },
  "status" : 400
}

```
modules/lang-painless/src/main/java/org/elasticsearch/painless/phase/DefaultSemanticAnalysisPhase.java
valueType = Object.class;
        }
        semanticScope.putDecoration(userNullNode, new ValueType(valueType));
    }
    /**
     * Visits a regex constant expression which does additional work to initialize a regex using pre-defined flags.
     * Checks: type validation
     */
    @Override
    public void visitRegex(ERegex userRegexNode, SemanticScope semanticScope) {
        String pattern = userRegexNode.getPattern();
        String flags = userRegexNode.getFlags();
        if (semanticScope.getCondition(userRegexNode, Write.class)) {
            throw userRegexNode.createError(
                new IllegalArgumentException(
                    "invalid assignment: cannot assign a value to regex constant [" + pattern + "] with flags [" + flags + "]"
                )
            );
        }
        if (semanticScope.getCondition(userRegexNode, Read.class) == false) {
            throw userRegexNode.createError(
                new IllegalArgumentException("not a statement: regex constant [" + pattern + "] with flags [" + flags + "] not used")
            );
        }
        if (semanticScope.getScriptScope().getCompilerSettings().areRegexesEnabled() == CompilerSettings.RegexEnabled.FALSE) {
            throw userRegexNode.createError(
                new IllegalStateException(
                    "Regexes are disabled. Set [script.painless.regex.enabled] to [true] "
                        + "in elasticsearch.yaml to allow them. Be careful though, regexes break out of Painless's protection against deep "
                        + "recursion and long loops."