code: private NumberSelectionResult findByRegex(List<String> numberQueries,
              Sid sourceOrganizationSid, Sid destOrg) {
          NumberSelectionResult numberFound = new NumberSelectionResult(null, false, null);
          IncomingPhoneNumberFilter.Builder filterBuilder = IncomingPhoneNumberFilter.Builder.builder();
          filterBuilder.byOrgSid(destOrg.toString());
          filterBuilder.byPureSIP(Boolean.TRUE);
          List<IncomingPhoneNumber> regexList = numbersDao.getIncomingPhoneNumbersRegex(filterBuilder.build());
          if (logger.isDebugEnabled()) {
              logger.debug(String.format("Found %d Regex IncomingPhone numbers.", regexList.size()));
          }
          //order by regex length
  
          Set<IncomingPhoneNumber> regexSet = new TreeSet<IncomingPhoneNumber>(new NumberLengthComparator());
          regexSet.addAll(regexList);
          if (regexList != null && regexList.size() > 0) {
              NumberSelectionResult matchingRegex = findFirstMatchingRegex(numberQueries, regexSet);
              if (matchingRegex.getNumber() != null) {
                  numberFound = matchingRegex;
              }
          }
  
          return numberFound;
      }
docs: This will take the regexes available in given organization, and evalute
  them agsint the given list of numbers, returning the first match.
  
  The list of regexes will be ordered by length to ensure the longest
  regexes matching any number in the list is returned first.
  
  In this case, organization details are required.
  
  @param numberQueries
  @param sourceOrganizationSid
  @param destOrg
  @return the longest regex matching any number in the list, null if no
  match