Regular Expression .net flavor

Posted by user1440109 on Stack Overflow See other posts from Stack Overflow or by user1440109
Published on 2012-06-21T03:12:55Z Indexed on 2012/06/21 3:15 UTC
Read the original article Hit count: 234

Filed under:
|
|

Dont ask how this works but currently it does ("^\|(.?)\|*$")....kinda. This removes all extra pipes...part one....I have searched all over no anwser yet. I am using VB2011 beta...asp web form......vb coding though!

I want to capture special character pipe (|) which is used to seperate words...i.e. car|truck|van|cycle

problem is users lead with, trail with, use multiple, and use spaces before and after...i.e. |||car||truck | van || cycle.

another example: george bush|micheal jordon|bill gates|steve jobs <-- this would be correct but when I do remove space it takes correct space out.

so I want to get rid of whitespace leading, trailing, any space before | and space after | and only allow one pipe (|)....in between alphanumeric of course.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about regex