LOG.debug( "regexp found: " + result.getLength() + " in " + (System.currentTimeMillis() - start) + "ms.");
	private NodeSet getNodesRegexp(		DocumentSet docs,		NodeSet context,		String expr,		int type) {		//long start = System.currentTimeMillis();		NodeSet result;		if (context == null)			result = new TextSearchResult(trackMatches != Serializer.TAG_NONE);		else			result = new ExtArrayNodeSet();		Value ref;		StringBuffer term;		Collection collection;		short collectionId;		Pattern regexp;		WordsCallback cb;		Lock lock = dbWords.getLock();		if (expr == null)			return null;		if (stoplist.contains(expr))			return null;		expr = expr.toLowerCase();		try {			regexp =				(type == DBBroker.MATCH_REGEXP					? regexCompiler.compile(expr, Perl5Compiler.CASE_INSENSITIVE_MASK)					: globCompiler.compile(						expr,						GlobCompiler.CASE_INSENSITIVE_MASK							| GlobCompiler.QUESTION_MATCHES_ZERO_OR_ONE_MASK));		} catch (MalformedPatternException e) {			LOG.debug(e);			return result;		}		term = new StringBuffer();		for (int j = 0; j < expr.length(); j++)			if (Character.isLetterOrDigit(expr.charAt(j)))				term.append(expr.charAt(j));			else				break;		cb = new WordsCallback(regexp, result, context, docs);		for (Iterator iter = docs.getCollectionIterator(); iter.hasNext();) {			collection = (Collection) iter.next();			collectionId = collection.getId();			if (term.length() > 0)				ref = new WordRef(collectionId, term.toString());			else				ref = new WordRef(collectionId);			IndexQuery query = new IndexQuery(IndexQuery.TRUNC_RIGHT, ref);			try {				lock.acquire();				try {					dbWords.query(query, cb);				} catch (IOException ioe) {					LOG.debug(ioe);				} catch (BTreeException bte) {					LOG.debug(bte);				}			} catch (LockException e) {				LOG.debug(e);			} finally {				lock.release();			}		}		//		LOG.debug(		//			"regexp found: "		//				+ result.getLength()		//				+ " in "		//				+ (System.currentTimeMillis() - start)		//				+ "ms.");		return result;	}