title: Split a string in java based on white spaces escaping those spaces in double quotes and single quotes and that which are preceded by \
body: <p>I am totally new to regular expressions. I'm trying to put together an expression that will split the example string using all spaces that are not surrounded by single or double quotes and are not preceded by a '\'</p>
  
  <p>Eg:- </p>
  
  <pre><code>He is a "man of his" words\ always
  </code></pre>
  
  <p>must be split as </p>
  
  <pre><code>He
  is 
  a 
  "man of his"
  words\ always
  </code></pre>
  
  <p>I understand </p>
  
  <pre><code>List&lt;String&gt; matchList = new ArrayList&lt;String&gt;();
  Pattern regex = Pattern.compile("[^\\s\"']+|\"[^\"]*\"|'[^']*'");
  Matcher regexMatcher = regex.matcher(StringToBeMatched);
  while (regexMatcher.find()) {
      matchList.add(regexMatcher.group());
  }
  </code></pre>
  
  <p>l split the example string using all spaces that are not surrounded by single or double quotes</p>
  
  <p>How do I incorporate the third condition of ignoring the white-space if it is preceded by a \ ??</p>