title: Javascript Unterminated string literal error
body: <p>I wonder whether someone could help me please.</p>
  
  <p>I've been working through help I received here: <a href="https://stackoverflow.com/questions/52811522/dynamic-table-and-dataset-in-scheduled-bigquery-job/52822941#52822941">Dynamic Table and Dataset in Scheduled BigQuery Job</a></p>
  
  <p>I've tried running the code, and I think there is an inherent problem, because when I run the code (below) I receive an error on this line:</p>
  
  <pre><code> "query": "SELECT
  </code></pre>
  
  <p>The error is "Unterminated string literal"</p>
  
  <pre><code>    function runQuery() {
  
            var yesterday = Utilities.formatDate(new Date(), "GMT", "dd-MM-yyyy'T'HH:mm:ss'Z'");
  
            var configuration = {
            "query": {
              "useQueryCache": false,
              "destinationTable": {
                    "projectId": "project_name_obfuscated",
                    "datasetId": "project_114151_shared",
                    "tableId": "test123"
                  },
              "writeDisposition": "WRITE_TRUNCATE",
              "createDisposition": "CREATE_IF_NEEDED",
              "allowLargeResults": true,
              "query": "SELECT * 
  FROM (SELECT hits.page.pagePath
  FROM
  [project:dataset.ga_sessions_20181015] 
  WHERE
  REGEXP_MATCH( hits.page.pagePath, r'\?email=.*@.*\.*')),
  (SELECT
  hits.eventInfo.eventLabel
  FROM
  [project:dataset.ga_sessions_20181015] 
  WHERE
  hits.eventInfo.eventAction = 'end-client,role,decision')"
        }
      };
  
      var job = {
          "configuration": configuration
      };
  
      var jobResult = BigQuery.Jobs.insert(job, "project_name_obfuscated");
  
      var jobId = jobResult.jobReference.jobId;
  
      // The job might not actually be done; wait until it is marked
      // complete.
      var sleepTimeMs = 500;
      while (true) {
          Utilities.sleep(sleepTimeMs);
          sleepTimeMs *= 2;
          queryResults = BigQuery.Jobs.getQueryResults(projectId, jobId, {
            "maxResults": 10000);
          if (!queryResults.jobComplete) {
            break;
          }
      }
  </code></pre>
  
  <p>I've been through various tutorials and tried adding the ' + solution so the line becomes "query": ' SELECT +</p>
  
  <p>But I still can't get the script to run.</p>
  
  <p>Could someone possible point out where I've gone wrong?</p>
  
  <p>Many thanks and kind regards!!</p>