Two different approaches; the first uses standard expl3 constructs, the second one uses regular expressions.
First
\documentclass{article}
\usepackage{collcell,xparse,xcolor}
\NewDocumentCommand{\coloritt}{O{blue}mo}{%
\IfNoValueTF{#3}{#2}{#2\textcolor{#1}{#3}}%
}
\ExplSyntaxOn
\NewDocumentCommand{\processcell}{m}
{
\sgmoye_processcell:n { #1 }
}
\tl_new:N \l_sgmoye_processcell_oargi_tl
\tl_new:N \l_sgmoye_processcell_oargii_tl
\tl_new:N \l_sgmoye_processcell_marg_tl
\seq_new:N \l_sgmoye_processcell_text_seq
\cs_new_protected:Npn \sgmoye_processcell:n #1
{
\tl_clear:N \l_sgmoye_processcell_oargi_tl
\tl_clear:N \l_sgmoye_processcell_oargii_tl
\tl_clear:N \l_sgmoye_processcell_marg_tl
\seq_set_split:Nnn \l_sgmoye_processcell_text_seq { ] } { #1 }
\int_compare:nTF { \seq_count:N \l_sgmoye_processcell_text_seq == 1 }
{ % no initial optional argument
\__sgmoye_other_args:n { #1 }
}
{
\tl_set:Nx \l_sgmoye_processcell_oargi_tl
{
\seq_item:Nn \l_sgmoye_processcell_text_seq { 1 } ] % reinstate the ]
}
\tl_set:Nx \l_sgmoye_processcell_marg_tl
{
\seq_item:Nn \l_sgmoye_processcell_text_seq { 2 }
}
\__sgmoye_other_args:V \l_sgmoye_processcell_marg_tl
}
\use:x
{
\coloritt
\exp_not:V \l_sgmoye_processcell_oargi_tl
\exp_not:V \l_sgmoye_processcell_marg_tl
\exp_not:V \l_sgmoye_processcell_oargii_tl
}
}
\cs_new_protected:Npn \__sgmoye_other_args:n #1
{
\seq_set_split:Nnn \l_sgmoye_processcell_text_seq { - } { #1 }
\int_compare:nTF { \seq_count:N \l_sgmoye_processcell_text_seq == 1 }
{ % no -
\tl_set:Nn \l_sgmoye_processcell_marg_tl { { #1 } }
}
{
\tl_set:Nx \l_sgmoye_processcell_marg_tl
{
{ \seq_item:Nn \l_sgmoye_processcell_text_seq { 1 } }
}
\tl_set:Nx \l_sgmoye_processcell_oargii_tl
{
[ \seq_item:Nn \l_sgmoye_processcell_text_seq { 2 } ]
}
}
}
\cs_generate_variant:Nn \__sgmoye_other_args:n { V }
\ExplSyntaxOff
\newcolumntype{L}{>{\collectcell\processcell}l<{\endcollectcell}}
\begin{document}
\begin{tabular}{lL}
Something&Some-thing\\
Ask&[red]Ask-ing\\ %% <<-- Does not work
NULL&NULL
\end{tabular}
\end{document}
Second
\documentclass{article}
\usepackage{collcell,xparse,l3regex,xcolor}
\NewDocumentCommand{\coloritt}{O{blue}mo}{%
\IfNoValueTF{#3}{#2}{#2\textcolor{#1}{#3}}%
}
\ExplSyntaxOn
\NewDocumentCommand{\processcell}{m}
{
\sgmoye_processcell:n { #1 }
}
\tl_new:N \l_sgmoye_processcell_oarg_tl
\tl_new:N \l_sgmoye_processcell_marg_tl
\seq_new:N \l_sgmoye_processcell_text_seq
\cs_new_protected:Npn \sgmoye_processcell:n #1
{
\tl_clear:N \l_sgmoye_processcell_oarg_tl
\regex_match:nnTF { \A \[ } { #1 }
{% there is an optional argument: split the two parts
\regex_extract_once:nnN { \A (\[.*\]) (.*) \Z } { #1 } \l_sgmoye_processcell_text_seq
\tl_set:Nx \l_sgmoye_processcell_oarg_tl
{
\seq_item:Nn \l_sgmoye_processcell_text_seq { 2 }
}
\tl_set:Nx \l_sgmoye_processcell_marg_tl
{
\seq_item:Nn \l_sgmoye_processcell_text_seq { 3 }
}
}
{
\tl_set:Nn \l_sgmoye_processcell_marg_tl { #1 }
}
\regex_match:nVTF { \- } \l_sgmoye_processcell_marg_tl
{
\regex_replace_once:nnN { \A (.*) \- (.*) \Z } { \cB\{\1\cE\}[\2] } \l_sgmoye_processcell_marg_tl
}
{
\tl_set:Nx \l_sgmoye_processcell_marg_tl
{
{ \exp_not:V \l_sgmoye_processcell_marg_tl }
}
}
\use:x
{
\coloritt
\exp_not:V \l_sgmoye_processcell_oarg_tl
\exp_not:V \l_sgmoye_processcell_marg_tl
}
}
\cs_generate_variant:Nn \regex_match:nnTF { nV }
\ExplSyntaxOff
\newcolumntype{L}{>{\collectcell\processcell}l<{\endcollectcell}}
\begin{document}
\begin{tabular}{lL}
Something&Some-thing\\
Ask&[red]Ask-ing\\
NULL&NULL
\end{tabular}
\end{document}
Output for both

;-)– egreg May 06 '15 at 12:50