@ for regular expression string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave

    #1

    @ for regular expression string

    I am trying to return a regular expression from code
    behind to server control in aspx page. Problem is
    regularexpressi onvalidator tag interprets string
    incorrectly.

    // aspx
    <asp:regularexp ressionvalidato r validationexpre ssion="<%#
    getTimeExpr()%> "

    // code behind
    _tiExpr = @"^((0?[1-9]|1[012])(:[0-5]\d){0,2}( [aApP][mM]))
    $|^([01]\d|2[0-3])(:[0-5]\d){1,2}$|^(hh: mm)$";

    public string getTImeExpr(){
    return _tiExpr;
    }

    if I paste the expression directly into tag property it
    works fine.

    Any ideas, thanks in advance
Working...