Package java.util.regex

Examples of java.util.regex.Matcher.find()


    StringBuffer sb = new StringBuffer();
    sb.append(comp.getSequence());

    Matcher m = fontColorPattern.matcher(sb);
    int txtStart = 0;
    while(m.find())
    {
      int txtEnd = m.end();
      if(txtStart < txtEnd)
      {
        String text = sb.substring(txtStart, txtEnd);
View Full Code Here


      //jdbc:hsqldb:mem:jbosscache
      Properties toReturn = (Properties) realProps.clone();
      String jdbcUrl = toReturn.getProperty("cache.jdbc.url");
      Pattern pattern = Pattern.compile("jbosscache");
      Matcher matcher = pattern.matcher(jdbcUrl);
      boolean found = matcher.find();
      assert found;
      String newJdbcUrl = matcher.replaceFirst(extractTestName() + userIndex.incrementAndGet());
      toReturn.put("cache.jdbc.url", newJdbcUrl);
      return toReturn;
   }
View Full Code Here

            }
            parentFile.mkdirs();
            Pattern p = Pattern.compile("class ([a-zA-Z0-9]+)");
            for (String model : models) {
                Matcher m = p.matcher(model);
                if (m.find()) {
                    String className = m.group().substring("class".length()).trim();
                    File classFile = new File(parentFile, className + ".java");
                    Writer o = new FileWriter(classFile, false);
                    PrintWriter writer = new PrintWriter(new BufferedWriter(o));
                    writer.write(model);
View Full Code Here

    String version = bytes.toString();

    Pattern p = Pattern.compile("Version:.*git(\\d{8}).*");
    Matcher match = p.matcher(version);

    if (match.find()) {
      if (Integer.parseInt(match.group(1)) >= WEBIF_MINIMUM_VERSION) {
        return true;
      }
    }

View Full Code Here

   *          Collect TV or radio channel
   */
  private void gatherChannels(StringBuffer webPage, TopfieldServiceType type) {
    ArrayList<SatelliteInfo> satellites = new ArrayList<SatelliteInfo>();
    Matcher infoMatcher = Pattern.compile(String.format(INFO_CREATE_FORMAT, type)).matcher(webPage);
    while (infoMatcher.find()) {
      satellites.add(new SatelliteInfo(Integer.parseInt(infoMatcher.group(1)), Integer.parseInt(infoMatcher.group(2)),
          infoMatcher.group(4)));
    }
    for (SatelliteInfo info : satellites) {
      Matcher channelMatcher = Pattern.compile(String.format(INFO_CHANNEL_FORMAT, type, info.getIndex())).matcher(
View Full Code Here

          infoMatcher.group(4)));
    }
    for (SatelliteInfo info : satellites) {
      Matcher channelMatcher = Pattern.compile(String.format(INFO_CHANNEL_FORMAT, type, info.getIndex())).matcher(
          webPage);
      while (channelMatcher.find()) {
        int subIndex = Integer.parseInt(channelMatcher.group(1));
        int serviceIndex = Integer.parseInt(channelMatcher.group(2));
        Matcher serviceMatcher = Pattern.compile(String.format(INFO_SERVICE_FORMAT, type, info.getIndex(), subIndex))
            .matcher(webPage);
        Matcher tunerMatcher = Pattern.compile(String.format(INFO_TUNER_FORMAT, type, info.getIndex(), subIndex))
View Full Code Here

        Matcher serviceMatcher = Pattern.compile(String.format(INFO_SERVICE_FORMAT, type, info.getIndex(), subIndex))
            .matcher(webPage);
        Matcher tunerMatcher = Pattern.compile(String.format(INFO_TUNER_FORMAT, type, info.getIndex(), subIndex))
            .matcher(webPage);
        serviceMatcher.find();
        tunerMatcher.find();
        String serviceName = serviceMatcher.group(1);
        serviceName = serviceName.substring(serviceName.indexOf(" ") + 1);
        TopfieldServiceInfo serviceInfo = new TopfieldServiceInfo(serviceIndex, info.getName(), info.getIndex(),
            serviceName, Integer.parseInt(tunerMatcher.group(1)), type == TopfieldServiceType.TV);
        channels.add(serviceInfo);
View Full Code Here

   * @param recordTime
   *          The time to modify
   */
  private void correctTime(StringBuffer formContent, ProgramTime recordTime) {
    Matcher timeMatcher = RECEIVER_ADD_TIME_PATTERN.matcher(formContent);
    if (timeMatcher.find()) {
      int receiverPreroll = Integer.parseInt(timeMatcher.group(1));
      int receiverPostroll = Integer.parseInt(timeMatcher.group(2));

      recordTime.addMinutesToStart(receiverPreroll);
      recordTime.addMinutesToEnd(receiverPostroll * -1);
 
View Full Code Here

   */
  public void getTimerList() throws TopfieldConnectionException {
    ArrayList<TopfieldTimerEntry> timerList = new ArrayList<TopfieldTimerEntry>();
    StringBuffer content = readDeviceData(TIMER_LIST_PAGE);
    Matcher timerEntryMatcher = TIMER_ENTRY_PATTERN.matcher(content);
    while (timerEntryMatcher.find()) {
      if (timerEntryMatcher.group(2).equals("0")) {
        // This is a P-timer => skip it
        continue;
      }

View Full Code Here

        String line = reader.readLine();
        while (line != null) {

            matcher = pattern.matcher(line);
            if (matcher.find()) {
                // System.out.println("h: "+matcher.group(1)+"; m: "+matcher.group(2)+"; title: "+matcher.group(3)+"; short: "+matcher.group(4)+"; desc: "+matcher.group(5));
                int h = Integer.parseInt(matcher.group(1));
                int m = Integer.parseInt(matcher.group(2));
                String title = matcher.group(3);
                String shortInfo = matcher.group(4);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.