title: How do i get all table names who match a specific regex in mysql 8.0?
body: <p>I'm trying to retrieve all tables with specific name format,
  for performing union among those tables. 
  I'm using <strong>mysql  Ver 8.0.13</strong>, and i wrote this following query for retrieving the relevant tables:</p>
  
  <pre><code>show tables LIKE REGEX '^table_.+_class$';
  </code></pre>
  
  <p>I couldn't figure out the correct syntax for this query :/ </p>
  
  <p>Afterwards i'm planning to <strong>union all those tables</strong>.</p>
  
  <p>I would like to <strong>avoid</strong> writing this code since it doesn't scale  nicely:</p>
  
  <pre><code>SELECT * FROM table_french_class
  UNION
  SELECT * FROM table_history_class
  UNION
  SELECT * FROM table_pingpong_class
  UNION
  SELECT * FROM table_math_class
  UNION
  SELECT * FROM table_literature_class
  </code></pre>
  
  <p>Can someone suggest me how to handle this issue?</p>
  
  <p>Thank you</p>