Try this instead: Regexp reChar = regexp "[\\\\]u([0-9]+) +\\?" Or even better : Regexp reChar = regexp "\\\\u([0-9]+) +\\?" If you wanted to search for the brackets and not for the backslash, use : {code}Regexp reChar = regexp "\\[\\]u([0-9]+) +\\?"{code} regexp "\\[\\]u([0-9]+) +\