Results 1 to 10 of 28

Thread: Beginners programming challenge #27

Threaded View

  1. #1
    Join Date
    Sep 2009
    Location
    Canada, Montreal QC
    Beans
    1,809
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Beginners programming challenge #27

    Welcome to the 27th Beginners programming challenge.
    Because I have a bit of free time, I decided to post this programming challenge early.
    This means it will be a bit more complicated and will probably take more work to achieve.

    Task
    You will have to implement a small regular expression engine that imitates a small subset of the Perl style regular expressions. It will only have to do matching, no need for replace or other complicated features.
    You will then use it in a program that will take input and print the text that was first matched by the regular expression. Hopefully, this will introduce you to regular expressions and understand how such an engine works.
    These are the operators you will have to implement: * . $ ^ ? + and of course normal letters.

    Cookie points

    Cookie points will be awarded for the following extras:

    1. Implementing the | (or) operator.
    2. Implementing character classes (annotated with []).
    3. Take input from stdin if a file is not supplied so piping is possible on the command line.
    4. Printing every match and not only the first one.

    Disqualified Entries:

    Any overly obfuscated code will be immediately disqualified without account for programmers skill. Please remember that these challenges are for beginners and therefore the code should be easily readable and well commented.

    Any non-beginner entries will not be judged. Please use common sense when posting code examples. Please do not give beginners a copy paste solution before they have had a chance to try this for themselves.


    Assistance:

    If you require any help with this challenge please do not hesitate to come and chat to the development focus group. We have a channel on irc.freenode.net #ubuntu-beginners-dev
    Or you can pm me

    Have fun,
    Happy coding

    cgroza
    Last edited by cgroza; July 8th, 2012 at 11:38 PM.
    I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones.
    Freedom is measured in Stallmans.
    Projects: gEcrit

Tags for this Thread

Bookmarks

Posting Permissions

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