title: How to Replace text characters only in a column with date values but of VARCHAR data type in MySQL?
body: <p>I have a table with a column of dates which has had various values that have been cleansed from Excel dates etc to mysql dates and the last step that I want to run is to remove any non-date values in the column before I run an alter command to change the data type to DATE but unfortunately the query that I have written is giving me a few issues. The following is a sample of my dates:</p>
  
  <pre><code>CREATE TABLE `date_checks` 
          (  
          `Start_Date` varchar(255) DEFAULT NULL
          );
  </code></pre>
  
  <p>My Insert Statements:</p>
  
  <pre><code>INSERT INTO `date_checks` (`Start_Date`) VALUES
  ('04/04/2018'),
  ('01/05/2018'),
  ('3 years'),
  ('28/05/2018');
  </code></pre>
  
  <p>My Output</p>
  
  <pre><code>Start_Date
      04/04/2018
      01/05/2018
      3 years
      28/05/2018
  </code></pre>
  
  <p>The query that I am running is the following:</p>
  
  <pre><code>UPDATE 'date_checks' SET Start_Date = '' WHERE Start_Date NOT REGEXP '^[0-9]';
  </code></pre>
  
  <p>Now I am guessing because I have the value 3 at the start of my 3rd row, this won't get deleted, so I just wanted to get some help to make sure I do this the right way as all I would like in this column is date values. The REGEXP I have written is looking for everything that does not begin with a number but I am guessing I need to expand this to the way the dates are in the column for it to be more specific and accurate.</p>
  
  <p>If the above code runs OK, then I will run the following to change the data type:</p>
  
  <pre><code>ALTER TABLE date_checks MODIFY Start_Date DATE;
  </code></pre>
  
  <p>Would appreciate it, if somebody could advise that I am going about this the right way.</p>