Take the 2-minute tour ×
string line = @"George\t15\tStudent\tAddress\tB:\temp\profilepic.png";

string[] results = Regex.Split( line, @"(?<![a-zA-Z]:)\\t" )

it produces this list:


But I can not understand how it works, particularly I can't find information about the "<" operator.

share|improve this question
You are saying that you couldn't find any information about regex?? I think you haven't search enough.. –  Dor Cohen Apr 20 '12 at 21:24
@Dor cohen I have not said that –  Blau Apr 20 '12 at 21:25
@L.B. Maybe, you are right, I thought was better to start another question –  Blau Apr 20 '12 at 21:26
@Blau Your input string does not make sense. At all points, \t seems to mean a TAB character, except in the \temp case. –  Tomalak Apr 20 '12 at 21:28
show 6 more comments

2 Answers

up vote 3 down vote accepted

< is not itself an operator in this case. It's a part of the (?<!) construct, which performs negative lookbehind. Negative lookbehind can be a tricky concept and I personally think it falls into the category of "advanced regex."

(?<! begins the group and ) closes it.

share|improve this answer
add comment

?<! is a negative lookbehind assertion. This expression translates to "Find a \t character that is not immediately preceded by a letter and a colon together".

share|improve this answer
\t is not a TAB character, it's a sequence of two characters - '\' and 't'. The slash in regexp string is escaped once, and the string itself is prefixed with @, so regexp engine sees it as \\t. –  dasblinkenlight Apr 20 '12 at 21:30
Whoops... force of habit. Thanks! –  Thomas Kelley Apr 20 '12 at 21:34
add comment

Your Answer


