A parser that takes an opening square or round bracket, a number, a comma, another number, then a closing square or round bracket would be quite easy to make. But I haven't done it yet because I know that someone will then ask for something like [x, x+1], and then we have to decide what kinds of expressions you can write for the numbers.
I suppose you have to decide how you want to mark these intervals, as well: is it all-or-nothing, or do you give partial marks for each of the four components: two brackets, and two numbers?