text: Q:
  
  RegEx pattern oversteps the target
  
  I am working with a RegPattern to identify and capture URL's in a CSS file and appends a version identifier. This pattern works most of the time. However, one of the packaged CSS files is foiling it.
  url\((\""|\')?(?<path>(.*))?(\""|\')?\)
  
  When used with this chunk of CSS:
  .ui-widget-overlay { background: #252526 url(images/ui-bg_flat_0_252526_40x100.png) 50% 50% repeat-x; opacity: .50;filter:Alpha(Opacity=50); }
  
  It captures this chunk of text:
  url(images/ui-bg_flat_0_252526_40x100.png) 50% 50% repeat-x; opacity: .50;filter:Alpha(Opacity=50)
  
  This is being used in C# with a call to the Replace method.
  
  A:
  
  Your problem is greedy Regex. Since you have another bracket in your CSS, it makes .* as the whole strin.
  Use this:
   url\((\""|\')?(?<path>([^\)]+))?(\""|\')?\)
  
  I have replaced .* with [^\)]+ (you can use [^\)]*  but I feel URL cannot be blank) => so it will find all characters that are not closin brackets.
  
  