What's wrong with this Perl regular expression?

Posted by neversaint on Stack Overflow See other posts from Stack Overflow or by neversaint
Published on 2010-04-15T01:53:18Z Indexed on 2010/04/16 4:13 UTC
Read the original article Hit count: 175

Filed under:
|

I have a lines like this

NF419andZNF773 (e=10^-92,). 
ZNF571 (e=2 10^-14,)

What's the regex for extracting the results above so that it gives

NF419andZNF773 - 10^-92
ZNF571 - 2 10^-14

I tried this but fail.

$line =~ /(\w+)\s\(e=\s(.*),\)/;
print "$1 - $2\n";

© Stack Overflow or respective owner

Related posts about regex

Related posts about perl