I am trying to use the same string parsing macro as in String parsing macro fails within a minipage environment?; but this time in context of biblatex - and I'm having similar problems, I guess.
Here is an MWE, partially borrowing code from Biblatex: ifx inside DeclareFieldFormat:
\documentclass{article}
\def\parseMyNumHelper num0#1\relax{\edef\MyNum{#1}}
\def\parseMyNum#1{\edef\temp{#1}%
\expandafter\parseMyNumHelper\temp\relax}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{num01,
title = {Title1},
eprint = {MR001},
eprinttype = {mrnumber}}
@misc{num02,
title = {Title},
eprint = {002},
eprinttype = {mrnumber}}
@misc{num03,
title = {Title},
eprint = {MR003 (aa)},
eprinttype = {mrnumber}}
@misc{num04,
title = {Title},
eprint = {004 (bb)},
eprinttype = {mrnumber}}
\end{filecontents}
\usepackage{biblatex}
\addbibresource{\jobname.bib}
\DeclareFieldFormat{myentrykey}{%
\parseMyNum{#1} %
\textbf{Testing \MyNum: \textit{#1}}%
}
\makeatletter
\newbibmacro*{myentrycite}{% custom
\printfield[myentrykey]{entrykey}
} % end \newbibmacro*{
\makeatother
\DeclareCiteCommand{\myentrycite}
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\printtext{\usebibmacro{myentrycite}}}
{}
{\usebibmacro{postnote}}
\begin{document}
\def\testvar{num01}
\typeout{ a== \testvar, }
\typeout{ -- \meaning\parseMyNumHelper}
\typeout{ -- \meaning\parseMyNum}
\parseMyNum{\testvar}
\typeout{ b== \testvar, - \temp, - \MyNum}
\myentrycite{num03}
\end{document}
Here, as a result of the cite command, I'd like to print the last numeral of the citation entry key.
If you run this code once with pdflatex, things look reasonable:
a== num01,
-- macro:num0#1\relax ->\edef \MyNum {#1}
-- macro:#1->\edef \temp {#1}\expandafter \parseMyNumHelper \temp \relax
b== num01, - num01, - 1
However, if you then run bibtex, and pdflatex again, at this second run you get:
a== num01,
-- macro:num0#1\relax ->\edef \MyNum {#1}
-- macro:#1->\edef \temp {#1}\expandafter \parseMyNumHelper \temp \relax
b== num01, - num01, - 1
! Use of \parseMyNumHelper doesn't match its definition.
\temp ->n
um03
l.59 \myentrycite{num03}
? i
insert>\typeout{ \meaning\parseMyNumHelper }
macro:num0#1\relax ->\edef \MyNum {#1}
...
Here is the strange thing - I expect num03 to arrive to the macro, and it does; and yet, macro still crashes on it? And even more strange - if we continue to the end, the following output is generated:

... and what I can see is that the parsing "almost" succeeded (I get "Testing X" as I expected) - except the last validly set number is returned....
Well, in String parsing macro/minipage... , the problem was minipage not having the correct argument, and therefore interfering with the next of the \parse commands - in Biblatex: ifx inside DeclareFieldFormat, it is mentioned:
This is happening because you are using the \ifx test, which will only be true if the category codes of M and R are 'letter'. biblatex is passing the argument as a detokenized string, so the test fails.
... and I'm not really sure if that is related to this..
But in any case, I'd appreciate a lot if anyone can explain why does this "string parsing" macro crash here - and how can I get it to work as intended..
Many thanks in advance for any answers,
Cheers!

#1#2#3#4#5, which seems to work fine (posted below). Your answer helps me remember why I just can't call "string.split()" here, as I am sometimes used to:)Many thanks again - cheers! – sdaau May 23 '12 at 18:37\detokenize: I tried using it in many cases, and I think I failed; possibly because I don't really understand it: this: "\def\aa{test}\typeout{ = \aa, \detokenize{\aa} = }" produces "= test, \aa ="; I would have thought instead, that the\aawould have been either\ a aort e s t. I should look up more on this command, eventually.. Cheers! – sdaau May 23 '12 at 18:50