title: Regular expression to validate a URL safe string in Objective C
body: <p>In my iPhone application I am constructing a URL by passing some params</p>
  
  <p>as in </p>
  
  <pre><code>NSURL * url;
  url = [url URLByAppendingPathComponent:Param1];
  </code></pre>
  
  <p>Now I want to validate <code>Param1</code> to accept only the URL safe characters, other way around is to encode the URL I agree , but I need to validate the Param1 since it is exposed to the user to change, is there any stright forward native API to do so?, or Regex is the only way? please provide me the Regex if so , Thanx in advance</p>