$text = "\n Prefetching [sets] WebObjects to fetch a related set of EOs when fetching a specified set of EOs. This can create fewer fetches and free up database time for other applications.\n For instance, let's say that you have an Organization EO that had several Office EOs that each had an Address EO. Now let's say that you had a component which listed all of the Offices and Office Addresses for a specific Organization. Usually, you would fetch the Offices for an Organization and each repeating table row would try to fault each and every \"address\" relationship in each Office. That creates a fetch for each relationship fault, and a lot of round trips to the database which use a lot of resources and makes your thing slow.\n The solution is to tell WebObjects that after you fetch the Offices (using a single fetch), you would like to fetch all of their addresses (using another single fetch). This can be done with prefetching. Here we go:\n\n EOFetchSpecification spec = ...;\n String keypaths() = {\"offices\", \"offices.address\"}; // \"offices\" is a relationship in Organization, and \"address\" is a relationship in Office.\n spec.setPrefetchingRelationshipKeyPaths(new NSArray(keypaths));"; if ($text =~ /^ ( # Any amount of: ( \[ # An open brace .*? # Any amount of non-brace stuff \] # A close brace ) | # Or [^\[] # Anything that's not an open brace. )* \] # Followed by a close brace /xs ) { print "The article contains a closing brace \"]\" with no opening brace."; } else {print "Okay, joe.";}