title: Delphi - how to check if a string contains a set format of characters
body: <p>Im trying to sort my TV shows from my movies and I figured best way to do this would be to identify them vie the TV shows season and episode stamp.</p>
  
  <p>all my TV shows have the following format S00E00.</p>
  
  <p>tried the following </p>
  
  <pre><code>if (Pos(IntToStr(I), SR.Name) &gt; 0) and (Pos('S', SR.Name) &gt; 0) then
  result := true;
  </code></pre>
  
  <p>but that didn't work because if a movie had a title Containing 's' and any number it would copy it across.</p>
  
  <p>would need something like 
  if string pos "letter s followed by integer , integer ,letter  e , integer , integer" then result := true</p>
  
  <p>that was regardless if the episode is S01E03 or S09E12 will still copy.</p>
  
  <p>.........................................</p>
  
  <p>edited 12/22/2015</p>
  
  <p>.........................................</p>
  
  <p>Thanks Remy didn't think its would be that easy.</p>
  
  <p>here is the procedure just to clarify.</p>
  
  <pre><code>procedure TForm7.TvShowCopy (Format: string);// Format would be .mp4 or whatever you're using but since the procedure searches for a name matching "S00E00" format I suppose you wouldn't need the format and could just use *.*. 
  
  begin
  
    aTvshowFiles := TDirectory.GetFiles(STvshows,format,// aTVshowfiles  is a TStringDynArray , STvshows is the Source directory for the TV shows.
                     TSearchOption.soAllDirectories,
                     function(const Path: string; const SR: TSearchRec):Boolean
                     begin
                       result:= TRegEx.IsMatch(SR.Name, 'S[0-9][0-9]E[0-9][0-9]') 
                     end);
                       CopyFilesToPath(aTvshowFiles, DTvshows);
  end;
  </code></pre>
  
  <p>tested and would appear to be working.   </p>