Thread: Contest Sign-Up, Regular Expressions.

  1. #1
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361

    Contest Sign-Up, Regular Expressions.

    This is a relatively easy contest, so i'm only going to have it running for one week. All entries will be submitted to my email address ([email protected]) before 12:00AM (your time) on April 1st.
    Please play fair and don't search google or ask others for help on this; I know this is all over the internet.

    Your regular expression string matching functions will take the prototypes:
    Code:
    bool wildcmp(const TCHAR*, const TCHAR*); // Case sensitive
    bool wildicmp(const TCHAR*, const TCHAR*); // Case insensitive
    or equivalent (eg. bool wildcmp(const tstring&, const tstring&); ) As long as it satisfies the following expression: wildcmp(TEXT("*"), TEXT("Hello"));

    Both functions will work with either unicode or ASCII strings. Whether unicode strings are passed to your function depends on whether or not _UNICODE is #defined.
    The only wildcard operators you need to handle in your functions are '*' and '?'. Return true on success, and false on failure.

    Reply to this thread to sign yourself up (Contestant or Judge)

    Judges - 0
    Contestants - 2
    Sand-Drax
    Speedy5
    Last edited by Eibro; 03-29-2003 at 06:10 PM.

  2. #2
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    I will participate. I just got an idea on how it can be done really elegantly.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    648
    Sounds easy, I'm in!

    <....as long as I can find some time....>

  4. #4
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704

    hrmmm

    Perhaps you could explain what the functions are suppose to do. Instead of assuming every one that wants to play knows what Regular Expressions are, and what this function has to do with them.







    I know. I'm stupid.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  5. #5
    Registered User
    Join Date
    Jan 2003
    Posts
    648
    Can you be a little more specific? I mean this: "The only wildcard operators you need to handle in your functions are '*' and '?'. " isn't very helpful to know what our functions are supposed to do. Are those the ONLY things its supposed to do? How about [a-z], etc?

    May you please make a list of what needs to be in?

  6. #6
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    If you don't know what a regular expression is, look it up on google.

    These would all evaluate true:
    wildcmp(TEXT("H?l*"), TEXT("Hello"));
    wildcmp(TEXT("*"), TEXT("Hello World"));
    wildcmp(TEXT("R?gul* E??r*ns"), TEXT("Regular Expressions"));

    The two wildcard "operators" you must account for in your functions are '?' (where any single character is wild) and '*' (where any number of characters can be wild)

    This is a contest geared towards beginner programmers, although I encourage everyone to sign up.

  7. #7
    Registered User
    Join Date
    Jan 2003
    Posts
    648
    OK, got it. Just those two things and nothing else.

  8. #8
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109
    I'll try to see if I can fit some time into this. But I still have to research regular expressions. So, probably not, but I'll try, so do not count me in yet.

  9. #9
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    The functions compares two strings and returns true if and only if they are equal.

    The ? can match any single character.
    The * can match zero or more characters.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  10. #10
    Registered User
    Join Date
    Jan 2003
    Posts
    648
    Where do we send our submissions to?

  11. #11

  12. #12
    Registered User
    Join Date
    Jan 2003
    Posts
    648
    Question: What should this evaluate to? I have it evaluating to false.

    i*ko
    iskasko

    format:
    -pattern
    -text

  13. #13
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    That should evaluate true, since the asterix can be replaced by any number of characters.

    i[skas]ko == iskasko
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  14. #14
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704
    Ill participate. Sorry for late notice. Didnt see the new posts here.
    Ohhhh. I read the date wrong. So i guess never mind
    Last edited by dbgt goten; 04-05-2003 at 12:08 AM.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  15. #15
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    before 12:00AM (your time) on April 1st
    Is it too late to sign up now? If not, count me in.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Regular expressions [Boost]
    By Desolation in forum C++ Programming
    Replies: 8
    Last Post: 12-30-2006, 10:10 PM
  2. Regular expressions
    By JimpsEd in forum C Programming
    Replies: 5
    Last Post: 05-13-2006, 06:01 PM
  3. Help please: regular expressions in C++
    By reivaj7999 in forum C++ Programming
    Replies: 3
    Last Post: 08-24-2005, 01:11 AM
  4. New AI contest: sign up
    By Sang-drax in forum Contests Board
    Replies: 20
    Last Post: 07-27-2005, 05:54 PM
  5. Regular expressions
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 01-23-2005, 09:36 PM