Escape sequence - Tab character \t

Q

What is the escape sequence for the Tab character?

How to write a regular expression to captures tab delimited fields like this: Milk $0.99 No tax?

✍: FYIcenter.com

A

The escape sequence for the Tag character is \t, which is the same as \x09.

The regular expression to capture tab delimited fields is:

([^\t]*+)\t?

[^\t]*+   - repeats non-tab character pattern, without backtracking
\t?       - skips a tab character or nothing (the end)

Click the button to test this regular expression here online:

2013-01-26, 2413👍, 0💬