Hello Oleg,
Have you read carefully the (new) online help for the REGEXP question type?
For a number of reasons, the way of entering the very first Answer (Answer 1) in your list of answers has been changed. For Answer 1 you must now enter an answer text which a) is the "best" possible answer; b) is not a regular expression or - more exactly - will not be interpreted as a regular expression but "as is" and c) has a Grade value of 100%. This means that you may have to edit regexp questions created prior to Feb. 2007 if they do not obey these rules. You will notice that when you create a new regexp question the Grade value for Answer 1 is already automatically set at 100%. You must not change this. If, however, you did, a warning message would be issued when you save your question, allowing you the opportunity to go back and set things right. In Moodle 1.8+ you won't be able to save your question if you have accidentally changed the 100% grade for Answer 1 for another value (this should not happen).
> First: y=str[1][1];> If now I type "y =str[1][1];" for student answer, after submitting I get only "y" as an answer.
The First answer (best possible answer) is expecting an exact match. It is expecting y=str[1][1]; so student enters y =str[1][1]; (with an extra space aftehr the y) of course this is "wrong". The system accepts the correct beginning, i.e. "y", and strikes out the rest of the student's answer.
If you want to accept as correct all the answers with all those characters and any number of blank spaces in between, then you'll have to add as Answer 2 a regular expression such as the following (I am attaching it as screen shot below because of formatting problems in the HTML editor that I noticed in my previous post).
Finally, because my new system now incorporates a Hint system which needs to be able to generate all acceptable answers (i.e. those with a score > 0%) from a regular expression, it is not possible to have inside regular expressions which lead to acceptable answers any wildcard characters (+ or *) because they would lead to an "infinite" number of possible acceptable answers.
The wildcards are only to be used in the detection of wrong answers (missing words, etc.).
I hope this explains everyting, and I am sorry is this means you have to re-write a number of previously created questions in the former version of REGEXP.
All the best,
Joseph