Advertisement
wheeler

wxRegEx example

Mar 9th, 2014
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1.  
  2. bool File::LoadRemoteFile(const wxString &fstr)
  3. {
  4.     wxRegEx fileRegex(wxString(wxT("([\-dpcbls][rwx\-]{9})\s*([0-9]{1,15})\s*([a-z_][a-z0-9_]{0,30})\s*([a-z_][a-z0-9_]{0,30})\s*([0-9]{1,15})\s*([a-zA-Z]{3})\s*([0-9]{1,2})\s*([0-9\:]{4,5})\s*(.*)")));
  5.     // fstr = "drwxr-xr-x   2  user  group  123412  Feb 21 2013 file_name.cpp";
  6.     if (fileRegex.Matches(fstr))
  7.     {
  8.         // actions
  9.     } else
  10.     {
  11.         // alternative actions
  12.     }
  13.     return true;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement