in reply to Regular Expression required.

Can you specify criteria, e.g.:

Replies are listed 'Best First'.
Re^2: Regular Expression required.
by anand_perl (Novice) on Sep 18, 2008 at 12:04 UTC

    I want to match the strings without 'summary' word and the strings like rtl_genoa_cet_300color-46-13-03.BIN.xml,rtl_genoa_cet_300color-47-13-04.BIN.xml

    The strings like rtl_genoa_cet_300color.xml should not be matched

      Once again: could you specify criteria?

      Maybe say which ones below should be matched? I tried to change one thing in every string:
      • stl_genoa_cet_300color-46-13-03.BIN.xml (1st block changed)
      • rtl_genoi_cet_300color-46-13-03.BIN.xml (2nd block changed)
      • rtl_genoa_cit_300color-46-13-03.BIN.xml (3rd block changed)
      • rtl_genoacet_300color-46-13-03.BIN.xml (no 3rd block)
      • rtl_genoa_cet_400color-46-13-03.BIN.xml (4th block, number changed)
      • rtl_genoa_cet_300bw-46-13-03.BIN.xml (4th block, type changed)
      • rtl_genoa_cet_300color.BIN.xml (no dd-dd-dd block)
      • rtl_genoa_cet_300color-99-99-99.BIN.xml (dd-dd-dd block changed)
      • rtl_genoa_cet_300color-46-13-03.USR.xml (name after '.' changed)
      • rtl_genoa_cet_300color-46-13-03BIN.xml (only one '.' in string)
      • rtl_genoa_cet_300color-46-13-03.BINxml (no '.'s in string)
      • rtl_genoa_cet_300color-46-13-03.BIN.png (last block (extension) changed)
      There are many more possibilities, but I hope you get the point. I (we) have no idea where the matched string must be exactly the same. Tell us.

      I think that /^rtl_genoa_cet_300color-4\d-13-0\d\.BIN\.xml$/ will do what you asked.

      Probably it doesn't do what you meant...

      Updated. This is shorter...

      Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."