hellworld has asked for the wisdom of the Perl Monks concerning the following question:
And this is for printing HETATM lines that don't have HOH string and it has the same syntax with the one above, yet this works while the one at the top doesn't..while($text =~ m/((ATOM)(\s{1,})(\d{1,})(\s{1,})(\w+)(\s{1,})[A-Z]{1,} +(\s{1,})[A-Z]{1,}(\s{1,})(\d{1,})(\s{1,})(\W+\d+.\d+)(\s{1,})(\W+\d+. +\d+)(\s{1,})(\W+\d+.\d+)(\s{1,})(\W+\d+.\d+)(\s{1,})(\d+.\d+)(\s+)([A +-Z]{1}))/gi) { print MYFILE "$1"; print MYFILE "\n"; }
while($text =~ m/((ATOM)(\s{1,})(\d{1,})(\s{1,})(\w+)(\s{1,})[A-Z]{1,} +(\s{1,})[A-Z]{1,}(\s{1,})(\d{1,})(\s{1,})(\W+\d+.\d+)(\s{1,})(\W+\d+. +\d+)(\s{1,})(\W+\d+.\d+)(\s{1,})(\W+\d+.\d+)(\s{1,})(\d+.\d+)(\s+)([A +-Z]{1}))/gi) { print MYFILE "$1"; print MYFILE "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help for a regex problem ?
by CountZero (Bishop) on Jul 13, 2009 at 20:17 UTC | |
by hellworld (Novice) on Jul 13, 2009 at 20:24 UTC | |
by CountZero (Bishop) on Jul 13, 2009 at 20:39 UTC | |
by hellworld (Novice) on Jul 13, 2009 at 20:52 UTC | |
by CountZero (Bishop) on Jul 13, 2009 at 21:08 UTC | |
|
Re: Help for a regex problem ?
by biohisham (Priest) on Jul 14, 2009 at 00:48 UTC | |
|
Re: Help for a regex problem ?
by ashish.kvarma (Monk) on Jul 14, 2009 at 06:10 UTC |