Geeks With Blogs

News
Sal Sparacio's Blog .NET | c# | Computer Games | Windows Mobile | Solo IT / Programmer
I saw this nice RegEx today at Regexlib.com::

Title Tab Delimited Parser

Pattern [^\t]+|\t(?=\t)|\t$

Author Thomas Cox

Matching Text [a-zA-Z0-9,:!@#$%^&*()-+={}[]"',.]

Non-Matching Text Tabs

Description I wrote this for a company that was importing a variety of rich text separated by tabs. By applying this regular expression, you can filter out even empty fields which return as a single tab qualified by a tab in front of them unless its the end of the string, which will return a single tab as well. You can filter out the returned tabs in your .NET code. For NEWBIES, this expression says: "Return anything but Tabs, and separate data by the tabs" [^\t]+ "Or" | "For Empty Tabs, Return those that have a tab in front of them" \t(?=\t) "Or" | "Return Empty Tabs at the end of a string" \t$ Hope this helps you on your journey in learning Regular Expressions! You can contact me using my form at http://www.thomasdcox.com/contactme.aspx

Source Thomas Cox

::Link:: -- Sal Posted on Tuesday, March 6, 2007 1:20 PM | Back to top



Comments on this post: Tab Delimited Parser [ RegEx ]

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Sal Sparacio | Powered by: GeeksWithBlogs.net