Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2017-05-20 09:31
Flavor·PCRE (Legacy)

/
\A(?:[^\|]+\|){2}\K(?P<foo>[^\|]*)
/
g
Open regex in editor

Description

The aim of this regex is to extract only the Nth field from a delimited string.

In the example provided the delimited is the pipe character.

You will have to substitute the pipe character for whatever delimiter you are using.

Submitted by 0jag