Regular Expression to exclude pattern

Hi All

I am using regular expressions to determine how to group certain data. I've included an example of the data below.

USD_SPTR_2Y_725.5_PUT_EUROPEAN_09Q1|USD||European|
CAD_NDX_10Yx1Y_5.5_PUT_EUROPEAN_09Q1|CAD||European|

The regular expressions I am using is as follows and this is executed from a script but the search pattern is below.

[A-Z]{3}_SPTR..*_PUT_EUROPEAN,EQPUT,

This matches the first line and works fine.

What I would like is to have a similar regexp search but one that will exclude lines that include SPTR so this will pick up the second line and group it differently.

Any help as always is appreciated.

Thanks

what tool are you using? shell, sed, awk, perl, expr... ?

Apologies, should have made that clear. I'm using perl

use the same regex with !sign

Okay tried this

(!^[A-Z]{3}_SPTR)..*_PUT_EUROPEAN,NOSPTR,

But this doesn't match the second line.

If I do this

(?!^[A-Z]{3}_SPTR)..*_PUT_EUROPEAN,NOSPTR,

It includes both lines which is not quite what I want.

My perl command, stripped from the global file is this

$s_UniqueID =~ m/(?!^[A-Z]{3}_SPTR)..*_PUT_EUROPEAN/

don't make it too complicated, check for SPTR first

pseudocode

 if ($line !~ /SPTR/ ){
   # do you regex
 }