title: Google Analytics / Data Studio - Remove string from the middle of a URL before processing data
body: <p>I have a website with thousands of directories which I am trying to find out which are the most popular through using the following field</p>
  <pre><code>REGEXP_EXTRACT(Page,'(/[^/]+)')
  </code></pre>
  <p>This is working great following my previous question <a href="https://stackoverflow.com/questions/66334328/google-analytics-find-most-popular-site-directories">here</a>, however there is a random extra string in the URL which is impacting the figures.</p>
  <p>e.g</p>
  <ul>
  <li>sitename.com/directoryA returns the same page as</li>
  <li>sitename.com/randomstring/directoryA</li>
  </ul>
  <p>This means that when I run my field some of the views that should be attributed to the /directoryA/ are being attributed to /randomstring and my table reports as follows:</p>
  <ol>
  <li>/randomstring = 1,000 views</li>
  <li>directoryA = 800 views</li>
  <li>directoryB = 850 views</li>
  <li>...</li>
  </ol>
  <p>Does anyone know how to clean the data in Google Data studio so that /randomstring is removed from the URLs before I run my REGEXP_EXTRACT code?</p>