in reply to regular expression
Also, the regular expression is probably better written as:perl -e '(@x)=$ARGV[0]=~/\[(.*?)\]/g; print qq|$x[$#x];\n|' "enoyl-[a +cyl-carrier-protein] reductase [NADH] 2 [Silicibacter sp. TrichCH4B]. + " #--output--- Silicibacter sp. TrichCH4B;
(But that assumes matching "]" are guaranteed.)/\[([^\]]+)\]/
All great truths begin as blasphemies.
― George Bernard Shaw, writer, Nobel laureate (1856-1950)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regular expression
by muppetjones (Novice) on Mar 16, 2012 at 18:47 UTC |