Regular Expressions 101

Community Patterns

How to get various values within a pipe delimited string

1

Regular Expression
PCRE (PHP <7.3)

Description

We have a pipe delimited text file and each new record is separated by a CRLF. Each record has a fixed number of pipes, but not every column or field is valued, so there may be 2 or more pipes together. Is there a way to write a regex to parse out the third or fifth value? Many thanks in advance.

Submitted by Jon - 9 years ago