rsiedl has asked for the wisdom of the Perl Monks concerning the following question:
#/usr/bin/perl use strict; use warnings; my $string =<< "END"; ("Immunologic and Biological Factors"[MESH] OR "Immunosuppressive Agen +ts"[MESH] OR "Transplantation Immunology"[MESH] OR "Allergy and Immun +ology"[MESH] OR "Graft vs Host Disease"[MESH]) NOT ("Foo"[MESH] OR "B +ar"[MESH]) AND ("Kidney Transplantation"[MESH] OR "Liver Transplantat +ion"[MESH] OR "Heart Transplantation"[MESH]) NOT ("My Term"[MESH] OR +"Blah"[MESH]) NOT "foobar"[MESH] END # This removes all instances of 'NOT "anything"[MESH]' $string =~ s/ NOT ".*?"\[MESH\] ?//g; # This removes all instances of 'NOT (anything)' $string =~ s/ NOT \(.*?\) ?//g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: refine regex
by Corion (Patriarch) on Nov 26, 2004 at 11:34 UTC | |
by fglock (Vicar) on Nov 26, 2004 at 11:50 UTC | |
by ikegami (Patriarch) on Nov 26, 2004 at 14:49 UTC | |
by rsiedl (Friar) on Nov 26, 2004 at 11:58 UTC | |
by rsiedl (Friar) on Nov 26, 2004 at 11:40 UTC | |
by exussum0 (Vicar) on Nov 27, 2004 at 01:20 UTC | |
|
Re: refine regex
by ikegami (Patriarch) on Nov 26, 2004 at 15:11 UTC | |
|
Re: refine regex
by ikegami (Patriarch) on Nov 26, 2004 at 17:47 UTC |