regex search
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Tue, 14 Oct 2014 22:21:22 +0000 (22:21 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Tue, 14 Oct 2014 22:21:22 +0000 (22:21 +0000)
forester/java/src/org/forester/archaeopteryx/ArchaeopteryxE.java
forester/java/src/org/forester/archaeopteryx/ControlPanel.java
forester/java/src/org/forester/archaeopteryx/MainFrame.java
forester/java/src/org/forester/archaeopteryx/MainFrameApplet.java
forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java
forester/java/src/org/forester/archaeopteryx/Options.java
forester/java/src/org/forester/phylogeny/PhylogenyMethods.java

index ffac851..36afa08 100644 (file)
@@ -116,7 +116,6 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
     private JCheckBoxMenuItem           _search_whole_words_only_cbmi;
     private JCheckBoxMenuItem           _inverse_search_result_cbmi;
     private JCheckBoxMenuItem           _search_with_regex_cbmi;
-    
     private JCheckBoxMenuItem           _show_overview_cbmi;
     private JMenuItem                   _choose_minimal_confidence_mi;
     private JMenuItem                   _collapse_species_specific_subtrees;
@@ -253,6 +252,9 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
             getMainPanel().getControlPanel().search1();
         }
         else if ( o == _search_whole_words_only_cbmi ) {
+            if ( ( _search_with_regex_cbmi != null ) && _search_whole_words_only_cbmi.isSelected() ) {
+                _search_with_regex_cbmi.setSelected( false );
+            }
             updateOptions( getOptions() );
             getMainPanel().getControlPanel().search0();
             getMainPanel().getControlPanel().search1();
@@ -263,6 +265,12 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
             getMainPanel().getControlPanel().search1();
         }
         else if ( o == _search_with_regex_cbmi ) {
+            if ( ( _search_whole_words_only_cbmi != null ) && _search_with_regex_cbmi.isSelected() ) {
+                _search_whole_words_only_cbmi.setSelected( false );
+            }
+            if ( ( _search_case_senstive_cbmi != null ) && _search_with_regex_cbmi.isSelected() ) {
+                _search_case_senstive_cbmi.setSelected( true );
+            }
             updateOptions( getOptions() );
             getMainPanel().getControlPanel().search0();
             getMainPanel().getControlPanel().search1();
@@ -797,16 +805,7 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
         _options_jmenu
                 .add( _search_case_senstive_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_CASE_SENSITIVE_LABEL ) );
         _options_jmenu.add( _search_whole_words_only_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_TERMS_ONLY_LABEL ) );
-        
-        
-        
-        _options_jmenu
-        .add( _search_with_regex_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_REGEX_LABEL ) );
-
-        
-        
-        
-        
+        _options_jmenu.add( _search_with_regex_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_REGEX_LABEL ) );
         _options_jmenu
                 .add( _inverse_search_result_cbmi = new JCheckBoxMenuItem( MainFrame.INVERSE_SEARCH_RESULT_LABEL ) );
         customizeJMenuItem( _choose_font_mi );
@@ -840,12 +839,7 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
         customizeRadioButtonMenuItem( _ext_node_dependent_cladogram_rbmi,
                                       getOptions().getCladogramType() == CLADOGRAM_TYPE.EXT_NODE_SUM_DEP );
         customizeCheckBoxMenuItem( _show_overview_cbmi, getOptions().isShowOverview() );
-        
-        
         customizeCheckBoxMenuItem( _search_with_regex_cbmi, getOptions().isSearchWithRegex() );
-        
-        
-        
         customizeCheckBoxMenuItem( _search_whole_words_only_cbmi, getOptions().isMatchWholeTermsOnly() );
         customizeCheckBoxMenuItem( _inverse_search_result_cbmi, getOptions().isInverseSearchResult() );
         customizeCheckBoxMenuItem( _show_confidence_stddev_cbmi, getOptions().isShowConfidenceStddev() );
@@ -1364,9 +1358,7 @@ public class ArchaeopteryxE extends JApplet implements ActionListener {
                 && _show_confidence_stddev_cbmi.isSelected() );
         options.setMatchWholeTermsOnly( ( _search_whole_words_only_cbmi != null )
                 && _search_whole_words_only_cbmi.isSelected() );
-        options.setSearchWithRegex( ( _search_with_regex_cbmi != null )
-                                        && _search_with_regex_cbmi.isSelected() );
-        
+        options.setSearchWithRegex( ( _search_with_regex_cbmi != null ) && _search_with_regex_cbmi.isSelected() );
         options.setInverseSearchResult( ( _inverse_search_result_cbmi != null )
                 && _inverse_search_result_cbmi.isSelected() );
         if ( ( _rectangular_type_cbmi != null ) && _rectangular_type_cbmi.isSelected() ) {
index f532cc9..cffdfea 100644 (file)
@@ -1822,7 +1822,7 @@ final class ControlPanel extends JPanel implements ActionListener {
                     continue;
                 }
                 query = query.trim();
-                if ( query.indexOf( '+' ) >= 0 ) {
+                if ( ( query.indexOf( '+' ) >= 0 ) && !getOptions().isSearchWithRegex() ) {
                     nodes.addAll( PhylogenyMethods.searchDataLogicalAnd( query.split( "\\++" ),
                                                                          tree,
                                                                          getOptions().isSearchCaseSensitive(),
@@ -1835,8 +1835,6 @@ final class ControlPanel extends JPanel implements ActionListener {
                                                                getOptions().isSearchCaseSensitive(),
                                                                !getOptions().isMatchWholeTermsOnly(),
                                                                getOptions().isSearchWithRegex(),
-                                                               
-                                                               
                                                                isShowDomainArchitectures() ) );
                 }
             }
index 7708753..84d6185 100644 (file)
@@ -96,7 +96,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
     static final String         SEARCH_SUBHEADER                        = "Search:";\r
     static final String         DISPLAY_SUBHEADER                       = "Display:";\r
     static final String         SEARCH_TERMS_ONLY_LABEL                 = "Match Complete Terms Only";\r
-    static final String         SEARCH_REGEX_LABEL                       = "Search with Regular Expressions";\r
+    static final String         SEARCH_REGEX_LABEL                      = "Search with Regular Expressions";\r
     static final String         SEARCH_CASE_SENSITIVE_LABEL             = "Case Sensitive";\r
     static final String         INVERSE_SEARCH_RESULT_LABEL             = "Negate Result";\r
     static final String         COLOR_BY_TAXONOMIC_GROUP                = "Colorize by Taxonomic Group";\r
@@ -454,6 +454,9 @@ public abstract class MainFrame extends JFrame implements ActionListener {
             getMainPanel().getControlPanel().search1();\r
         }\r
         else if ( o == _search_whole_words_only_cbmi ) {\r
+            if ( ( _search_with_regex_cbmi != null ) && _search_whole_words_only_cbmi.isSelected() ) {\r
+                _search_with_regex_cbmi.setSelected( false );\r
+            }\r
             updateOptions( getOptions() );\r
             getMainPanel().getControlPanel().search0();\r
             getMainPanel().getControlPanel().search1();\r
@@ -464,6 +467,12 @@ public abstract class MainFrame extends JFrame implements ActionListener {
             getMainPanel().getControlPanel().search1();\r
         }\r
         else if ( o == _search_with_regex_cbmi ) {\r
+            if ( ( _search_whole_words_only_cbmi != null ) && _search_with_regex_cbmi.isSelected() ) {\r
+                _search_whole_words_only_cbmi.setSelected( false );\r
+            }\r
+            if ( ( _search_case_senstive_cbmi != null ) && _search_with_regex_cbmi.isSelected() ) {\r
+                _search_case_senstive_cbmi.setSelected( true );\r
+            }\r
             updateOptions( getOptions() );\r
             getMainPanel().getControlPanel().search0();\r
             getMainPanel().getControlPanel().search1();\r
@@ -1388,9 +1397,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                 && _allow_errors_in_distance_to_parent_cbmi.isSelected() );\r
         options.setMatchWholeTermsOnly( ( _search_whole_words_only_cbmi != null )\r
                 && _search_whole_words_only_cbmi.isSelected() );\r
-        options.setSearchWithRegex( ( _search_with_regex_cbmi != null )\r
-                                    && _search_with_regex_cbmi.isSelected() );\r
-        \r
+        options.setSearchWithRegex( ( _search_with_regex_cbmi != null ) && _search_with_regex_cbmi.isSelected() );\r
         options.setInverseSearchResult( ( _inverse_search_result_cbmi != null )\r
                 && _inverse_search_result_cbmi.isSelected() );\r
         if ( _graphics_export_visible_only_cbmi != null ) {\r
index c6bd428..863bd08 100644 (file)
@@ -246,14 +246,7 @@ public final class MainFrameApplet extends MainFrame {
         _options_jmenu
                 .add( _search_case_senstive_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_CASE_SENSITIVE_LABEL ) );
         _options_jmenu.add( _search_whole_words_only_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_TERMS_ONLY_LABEL ) );
-       
-        
-        
-        _options_jmenu
-        .add( _search_with_regex_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_REGEX_LABEL ) );
-
-        
-        
+        _options_jmenu.add( _search_with_regex_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_REGEX_LABEL ) );
         _options_jmenu.add( _inverse_search_result_cbmi = new JCheckBoxMenuItem( INVERSE_SEARCH_RESULT_LABEL ) );
         customizeJMenuItem( _choose_font_mi );
         customizeJMenuItem( _switch_colors_mi );
@@ -286,15 +279,7 @@ public final class MainFrameApplet extends MainFrame {
         customizeCheckBoxMenuItem( _show_overview_cbmi, getOptions().isShowOverview() );
         customizeCheckBoxMenuItem( _label_direction_cbmi,
                                    getOptions().getNodeLabelDirection() == NODE_LABEL_DIRECTION.RADIAL );
-        
-        
-        
         customizeCheckBoxMenuItem( _search_with_regex_cbmi, getOptions().isSearchWithRegex() );
-        
-        
-        
-        
-        
         customizeCheckBoxMenuItem( _search_whole_words_only_cbmi, getOptions().isMatchWholeTermsOnly() );
         customizeCheckBoxMenuItem( _inverse_search_result_cbmi, getOptions().isInverseSearchResult() );
         customizeCheckBoxMenuItem( _show_confidence_stddev_cbmi, getOptions().isShowConfidenceStddev() );
index 6d0ba08..cc6fbe5 100644 (file)
@@ -935,13 +935,7 @@ public final class MainFrameApplication extends MainFrame {
         _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( SEARCH_SUBHEADER ), getConfiguration() ) );\r
         _options_jmenu.add( _search_case_senstive_cbmi = new JCheckBoxMenuItem( SEARCH_CASE_SENSITIVE_LABEL ) );\r
         _options_jmenu.add( _search_whole_words_only_cbmi = new JCheckBoxMenuItem( SEARCH_TERMS_ONLY_LABEL ) );\r
-       \r
-        \r
-        _options_jmenu\r
-        .add( _search_with_regex_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_REGEX_LABEL ) );\r
-\r
-        \r
-        \r
+        _options_jmenu.add( _search_with_regex_cbmi = new JCheckBoxMenuItem( MainFrame.SEARCH_REGEX_LABEL ) );\r
         _options_jmenu.add( _inverse_search_result_cbmi = new JCheckBoxMenuItem( INVERSE_SEARCH_RESULT_LABEL ) );\r
         _options_jmenu.addSeparator();\r
         _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( "Graphics Export & Printing:" ),\r
@@ -1036,12 +1030,7 @@ public final class MainFrameApplication extends MainFrame {
         customizeCheckBoxMenuItem( _replace_underscores_cbmi, getOptions().isReplaceUnderscoresInNhParsing() );\r
         customizeCheckBoxMenuItem( _allow_errors_in_distance_to_parent_cbmi, getOptions()\r
                 .isReplaceUnderscoresInNhParsing() );\r
-        \r
-        \r
         customizeCheckBoxMenuItem( _search_with_regex_cbmi, getOptions().isSearchWithRegex() );\r
-        \r
-        \r
-        \r
         customizeCheckBoxMenuItem( _search_whole_words_only_cbmi, getOptions().isMatchWholeTermsOnly() );\r
         customizeCheckBoxMenuItem( _inverse_search_result_cbmi, getOptions().isInverseSearchResult() );\r
         customizeCheckBoxMenuItem( _graphics_export_visible_only_cbmi, getOptions().isGraphicsExportVisibleOnly() );\r
index b6992f0..8167a92 100644 (file)
@@ -256,7 +256,7 @@ final public class Options {
     final boolean isMatchWholeTermsOnly() {
         return _match_whole_terms_only;
     }
-    
+
     final boolean isSearchWithRegex() {
         return _search_with_regex;
     }
@@ -366,7 +366,7 @@ final public class Options {
     final void setMatchWholeTermsOnly( final boolean search_whole_words_only ) {
         _match_whole_terms_only = search_whole_words_only;
     }
-    
+
     final void setSearchWithRegex( final boolean search_with_regex ) {
         _search_with_regex = search_with_regex;
     }
@@ -481,7 +481,7 @@ final public class Options {
         _base_font = new Font( Configuration.getDefaultFontFamilyName(), Font.PLAIN, 10 );
         _match_whole_terms_only = false;
         _search_with_regex = false;
-        _search_case_sensitive = false;
+        _search_case_sensitive = true;
         _print_line_width = Constants.PDF_LINE_WIDTH_DEFAULT;
         _show_overview = true;
         _ov_placement = OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT;
index 025b098..f7aa56d 100644 (file)
@@ -941,8 +941,7 @@ public class PhylogenyMethods {
                                                   final boolean case_sensitive,\r
                                                   final boolean partial,\r
                                                   final boolean regex,\r
-                                                  final boolean search_domains\r
-                                                   ) {\r
+                                                  final boolean search_domains ) {\r
         final List<PhylogenyNode> nodes = new ArrayList<PhylogenyNode>();\r
         if ( phy.isEmpty() || ( query == null ) ) {\r
             return nodes;\r
@@ -957,15 +956,19 @@ public class PhylogenyMethods {
                 match = true;\r
             }\r
             else if ( node.getNodeData().isHasTaxonomy()\r
-                    && match( node.getNodeData().getTaxonomy().getTaxonomyCode(), query, case_sensitive, partial ) ) {\r
+                    && match( node.getNodeData().getTaxonomy().getTaxonomyCode(), query, case_sensitive, partial, regex ) ) {\r
                 match = true;\r
             }\r
             else if ( node.getNodeData().isHasTaxonomy()\r
-                    && match( node.getNodeData().getTaxonomy().getCommonName(), query, case_sensitive, partial ) ) {\r
+                    && match( node.getNodeData().getTaxonomy().getCommonName(), query, case_sensitive, partial, regex ) ) {\r
                 match = true;\r
             }\r
             else if ( node.getNodeData().isHasTaxonomy()\r
-                    && match( node.getNodeData().getTaxonomy().getScientificName(), query, case_sensitive, partial ) ) {\r
+                    && match( node.getNodeData().getTaxonomy().getScientificName(),\r
+                              query,\r
+                              case_sensitive,\r
+                              partial,\r
+                              regex ) ) {\r
                 match = true;\r
             }\r
             else if ( node.getNodeData().isHasTaxonomy()\r
@@ -973,28 +976,29 @@ public class PhylogenyMethods {
                     && match( node.getNodeData().getTaxonomy().getIdentifier().getValue(),\r
                               query,\r
                               case_sensitive,\r
-                              partial ) ) {\r
+                              partial,\r
+                              regex ) ) {\r
                 match = true;\r
             }\r
             else if ( node.getNodeData().isHasTaxonomy() && !node.getNodeData().getTaxonomy().getSynonyms().isEmpty() ) {\r
                 final List<String> syns = node.getNodeData().getTaxonomy().getSynonyms();\r
                 I: for( final String syn : syns ) {\r
-                    if ( match( syn, query, case_sensitive, partial ) ) {\r
+                    if ( match( syn, query, case_sensitive, partial, regex ) ) {\r
                         match = true;\r
                         break I;\r
                     }\r
                 }\r
             }\r
             if ( !match && node.getNodeData().isHasSequence()\r
-                    && match( node.getNodeData().getSequence().getName(), query, case_sensitive, partial ) ) {\r
+                    && match( node.getNodeData().getSequence().getName(), query, case_sensitive, partial, regex ) ) {\r
                 match = true;\r
             }\r
             if ( !match && node.getNodeData().isHasSequence()\r
-                    && match( node.getNodeData().getSequence().getGeneName(), query, case_sensitive, partial ) ) {\r
+                    && match( node.getNodeData().getSequence().getGeneName(), query, case_sensitive, partial, regex ) ) {\r
                 match = true;\r
             }\r
             if ( !match && node.getNodeData().isHasSequence()\r
-                    && match( node.getNodeData().getSequence().getSymbol(), query, case_sensitive, partial ) ) {\r
+                    && match( node.getNodeData().getSequence().getSymbol(), query, case_sensitive, partial, regex ) ) {\r
                 match = true;\r
             }\r
             if ( !match\r
@@ -1003,28 +1007,28 @@ public class PhylogenyMethods {
                     && match( node.getNodeData().getSequence().getAccession().getValue(),\r
                               query,\r
                               case_sensitive,\r
-                              partial ) ) {\r
+                              partial,\r
+                              regex ) ) {\r
                 match = true;\r
             }\r
             if ( search_domains && !match && node.getNodeData().isHasSequence()\r
                     && ( node.getNodeData().getSequence().getDomainArchitecture() != null ) ) {\r
                 final DomainArchitecture da = node.getNodeData().getSequence().getDomainArchitecture();\r
                 I: for( int i = 0; i < da.getNumberOfDomains(); ++i ) {\r
-                    if ( match( da.getDomain( i ).getName(), query, case_sensitive, partial ) ) {\r
+                    if ( match( da.getDomain( i ).getName(), query, case_sensitive, partial, regex ) ) {\r
                         match = true;\r
                         break I;\r
                     }\r
                 }\r
             }\r
-            //\r
             if ( !match && node.getNodeData().isHasSequence()\r
                     && ( node.getNodeData().getSequence().getAnnotations() != null ) ) {\r
                 for( final Annotation ann : node.getNodeData().getSequence().getAnnotations() ) {\r
-                    if ( match( ann.getDesc(), query, case_sensitive, partial ) ) {\r
+                    if ( match( ann.getDesc(), query, case_sensitive, partial, regex ) ) {\r
                         match = true;\r
                         break;\r
                     }\r
-                    if ( match( ann.getRef(), query, case_sensitive, partial ) ) {\r
+                    if ( match( ann.getRef(), query, case_sensitive, partial, regex ) ) {\r
                         match = true;\r
                         break;\r
                     }\r
@@ -1033,15 +1037,15 @@ public class PhylogenyMethods {
             if ( !match && node.getNodeData().isHasSequence()\r
                     && ( node.getNodeData().getSequence().getCrossReferences() != null ) ) {\r
                 for( final Accession x : node.getNodeData().getSequence().getCrossReferences() ) {\r
-                    if ( match( x.getComment(), query, case_sensitive, partial ) ) {\r
+                    if ( match( x.getComment(), query, case_sensitive, partial, regex ) ) {\r
                         match = true;\r
                         break;\r
                     }\r
-                    if ( match( x.getSource(), query, case_sensitive, partial ) ) {\r
+                    if ( match( x.getSource(), query, case_sensitive, partial, regex ) ) {\r
                         match = true;\r
                         break;\r
                     }\r
-                    if ( match( x.getValue(), query, case_sensitive, partial ) ) {\r
+                    if ( match( x.getValue(), query, case_sensitive, partial, regex ) ) {\r
                         match = true;\r
                         break;\r
                     }\r
@@ -1051,14 +1055,14 @@ public class PhylogenyMethods {
             if ( !match && ( node.getNodeData().getBinaryCharacters() != null ) ) {\r
                 Iterator<String> it = node.getNodeData().getBinaryCharacters().getPresentCharacters().iterator();\r
                 I: while ( it.hasNext() ) {\r
-                    if ( match( it.next(), query, case_sensitive, partial ) ) {\r
+                    if ( match( it.next(), query, case_sensitive, partial, regex ) ) {\r
                         match = true;\r
                         break I;\r
                     }\r
                 }\r
                 it = node.getNodeData().getBinaryCharacters().getGainedCharacters().iterator();\r
                 I: while ( it.hasNext() ) {\r
-                    if ( match( it.next(), query, case_sensitive, partial ) ) {\r
+                    if ( match( it.next(), query, case_sensitive, partial, regex ) ) {\r
                         match = true;\r
                         break I;\r
                     }\r
@@ -1088,19 +1092,31 @@ public class PhylogenyMethods {
                 if ( ForesterUtil.isEmpty( query ) ) {\r
                     continue;\r
                 }\r
-                if ( match( node.getName(), query, case_sensitive, partial ) ) {\r
+                if ( match( node.getName(), query, case_sensitive, partial, false ) ) {\r
                     match = true;\r
                 }\r
                 else if ( node.getNodeData().isHasTaxonomy()\r
-                        && match( node.getNodeData().getTaxonomy().getTaxonomyCode(), query, case_sensitive, partial ) ) {\r
+                        && match( node.getNodeData().getTaxonomy().getTaxonomyCode(),\r
+                                  query,\r
+                                  case_sensitive,\r
+                                  partial,\r
+                                  false ) ) {\r
                     match = true;\r
                 }\r
                 else if ( node.getNodeData().isHasTaxonomy()\r
-                        && match( node.getNodeData().getTaxonomy().getCommonName(), query, case_sensitive, partial ) ) {\r
+                        && match( node.getNodeData().getTaxonomy().getCommonName(),\r
+                                  query,\r
+                                  case_sensitive,\r
+                                  partial,\r
+                                  false ) ) {\r
                     match = true;\r
                 }\r
                 else if ( node.getNodeData().isHasTaxonomy()\r
-                        && match( node.getNodeData().getTaxonomy().getScientificName(), query, case_sensitive, partial ) ) {\r
+                        && match( node.getNodeData().getTaxonomy().getScientificName(),\r
+                                  query,\r
+                                  case_sensitive,\r
+                                  partial,\r
+                                  false ) ) {\r
                     match = true;\r
                 }\r
                 else if ( node.getNodeData().isHasTaxonomy()\r
@@ -1108,29 +1124,31 @@ public class PhylogenyMethods {
                         && match( node.getNodeData().getTaxonomy().getIdentifier().getValue(),\r
                                   query,\r
                                   case_sensitive,\r
-                                  partial ) ) {\r
+                                  partial,\r
+                                  false ) ) {\r
                     match = true;\r
                 }\r
                 else if ( node.getNodeData().isHasTaxonomy()\r
                         && !node.getNodeData().getTaxonomy().getSynonyms().isEmpty() ) {\r
                     final List<String> syns = node.getNodeData().getTaxonomy().getSynonyms();\r
                     I: for( final String syn : syns ) {\r
-                        if ( match( syn, query, case_sensitive, partial ) ) {\r
+                        if ( match( syn, query, case_sensitive, partial, false ) ) {\r
                             match = true;\r
                             break I;\r
                         }\r
                     }\r
                 }\r
                 if ( !match && node.getNodeData().isHasSequence()\r
-                        && match( node.getNodeData().getSequence().getName(), query, case_sensitive, partial ) ) {\r
+                        && match( node.getNodeData().getSequence().getName(), query, case_sensitive, partial, false ) ) {\r
                     match = true;\r
                 }\r
-                if ( !match && node.getNodeData().isHasSequence()\r
-                        && match( node.getNodeData().getSequence().getGeneName(), query, case_sensitive, partial ) ) {\r
+                if ( !match\r
+                        && node.getNodeData().isHasSequence()\r
+                        && match( node.getNodeData().getSequence().getGeneName(), query, case_sensitive, partial, false ) ) {\r
                     match = true;\r
                 }\r
                 if ( !match && node.getNodeData().isHasSequence()\r
-                        && match( node.getNodeData().getSequence().getSymbol(), query, case_sensitive, partial ) ) {\r
+                        && match( node.getNodeData().getSequence().getSymbol(), query, case_sensitive, partial, false ) ) {\r
                     match = true;\r
                 }\r
                 if ( !match\r
@@ -1139,14 +1157,15 @@ public class PhylogenyMethods {
                         && match( node.getNodeData().getSequence().getAccession().getValue(),\r
                                   query,\r
                                   case_sensitive,\r
-                                  partial ) ) {\r
+                                  partial,\r
+                                  false ) ) {\r
                     match = true;\r
                 }\r
                 if ( search_domains && !match && node.getNodeData().isHasSequence()\r
                         && ( node.getNodeData().getSequence().getDomainArchitecture() != null ) ) {\r
                     final DomainArchitecture da = node.getNodeData().getSequence().getDomainArchitecture();\r
                     I: for( int i = 0; i < da.getNumberOfDomains(); ++i ) {\r
-                        if ( match( da.getDomain( i ).getName(), query, case_sensitive, partial ) ) {\r
+                        if ( match( da.getDomain( i ).getName(), query, case_sensitive, partial, false ) ) {\r
                             match = true;\r
                             break I;\r
                         }\r
@@ -1156,11 +1175,11 @@ public class PhylogenyMethods {
                 if ( !match && node.getNodeData().isHasSequence()\r
                         && ( node.getNodeData().getSequence().getAnnotations() != null ) ) {\r
                     for( final Annotation ann : node.getNodeData().getSequence().getAnnotations() ) {\r
-                        if ( match( ann.getDesc(), query, case_sensitive, partial ) ) {\r
+                        if ( match( ann.getDesc(), query, case_sensitive, partial, false ) ) {\r
                             match = true;\r
                             break;\r
                         }\r
-                        if ( match( ann.getRef(), query, case_sensitive, partial ) ) {\r
+                        if ( match( ann.getRef(), query, case_sensitive, partial, false ) ) {\r
                             match = true;\r
                             break;\r
                         }\r
@@ -1169,15 +1188,15 @@ public class PhylogenyMethods {
                 if ( !match && node.getNodeData().isHasSequence()\r
                         && ( node.getNodeData().getSequence().getCrossReferences() != null ) ) {\r
                     for( final Accession x : node.getNodeData().getSequence().getCrossReferences() ) {\r
-                        if ( match( x.getComment(), query, case_sensitive, partial ) ) {\r
+                        if ( match( x.getComment(), query, case_sensitive, partial, false ) ) {\r
                             match = true;\r
                             break;\r
                         }\r
-                        if ( match( x.getSource(), query, case_sensitive, partial ) ) {\r
+                        if ( match( x.getSource(), query, case_sensitive, partial, false ) ) {\r
                             match = true;\r
                             break;\r
                         }\r
-                        if ( match( x.getValue(), query, case_sensitive, partial ) ) {\r
+                        if ( match( x.getValue(), query, case_sensitive, partial, false ) ) {\r
                             match = true;\r
                             break;\r
                         }\r
@@ -1187,14 +1206,14 @@ public class PhylogenyMethods {
                 if ( !match && ( node.getNodeData().getBinaryCharacters() != null ) ) {\r
                     Iterator<String> it = node.getNodeData().getBinaryCharacters().getPresentCharacters().iterator();\r
                     I: while ( it.hasNext() ) {\r
-                        if ( match( it.next(), query, case_sensitive, partial ) ) {\r
+                        if ( match( it.next(), query, case_sensitive, partial, false ) ) {\r
                             match = true;\r
                             break I;\r
                         }\r
                     }\r
                     it = node.getNodeData().getBinaryCharacters().getGainedCharacters().iterator();\r
                     I: while ( it.hasNext() ) {\r
-                        if ( match( it.next(), query, case_sensitive, partial ) ) {\r
+                        if ( match( it.next(), query, case_sensitive, partial, false ) ) {\r
                             match = true;\r
                             break I;\r
                         }\r
@@ -1618,16 +1637,8 @@ public class PhylogenyMethods {
     private static boolean match( final String s,\r
                                   final String query,\r
                                   final boolean case_sensitive,\r
-                                  final boolean partial ) {\r
-        return match( s, query, case_sensitive, partial, false );\r
-    }\r
-\r
-    private static boolean match( final String s,\r
-                                  final String query,\r
-                                  final boolean case_sensitive,\r
                                   final boolean partial,\r
                                   final boolean regex ) {\r
-       \r
         if ( ForesterUtil.isEmpty( s ) || ForesterUtil.isEmpty( query ) ) {\r
             return false;\r
         }\r
@@ -1648,13 +1659,13 @@ public class PhylogenyMethods {
                 }\r
             }\r
             catch ( final PatternSyntaxException e ) {\r
-                throw e;\r
+                return false;\r
             }\r
             if ( p != null ) {\r
                 return p.matcher( my_s ).find();\r
             }\r
             else {\r
-                throw new RuntimeException( "failed to create new pattern" );\r
+                return false;\r
             }\r
         }\r
         else if ( partial ) {\r