Page 2 of 2 FirstFirst 12
Results 21 to 24 of 24
  1. #21
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,457
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by liran View Post
    Actually all the tests are working except the last one:

    b=check("abgcd", "ab?cd");
    assertEquals(b,true);

    b=check("abddcd", "ab?cd");
    assertEquals(b,false);

    check("alonggood.txt", "alon?good.*");
    assertEquals(b2,true);

    check("389-211-02.txt", "?89*");
    assertEquals(b3,true);

    //fails
    check("89-211-02.txt", "?89*");
    assertEquals(b3,false);

    I think i just need to fix the last one (or maybe some more...)
    What do you want the '?' to match? Exactlly one (arbitrary) character or at most one character?

    kind regards,

    Jos

  2. #22
    liran is offline Member
    Join Date
    Apr 2010
    Posts
    18
    Rep Power
    0

    Default

    Exactly one (I think it can be assumed from the definition).

  3. #23
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,457
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by liran View Post
    Exactly one (I think it can be assumed from the definition).
    The third rule should be replaced by this:

    Java Code:
    exp= exp.replace("?", ".");
    kind regards,

    Jos

  4. #24
    liran is offline Member
    Join Date
    Apr 2010
    Posts
    18
    Rep Power
    0

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Java, Military Format using "/" and "%" Operator!!
    By sk8rsam77 in forum New To Java
    Replies: 11
    Last Post: 02-26-2010, 03:03 AM
  2. Replies: 0
    Last Post: 04-02-2009, 07:02 PM
  3. have "regular" functions - with no class
    By itaipee in forum New To Java
    Replies: 2
    Last Post: 01-29-2009, 03:12 PM
  4. Replies: 1
    Last Post: 10-20-2008, 07:35 AM
  5. Struts 1.x <bean:write format="0.00%"> help?
    By prabhurangan in forum Web Frameworks
    Replies: 0
    Last Post: 07-02-2008, 12:59 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •