Regular Expressions 101

Community Patterns

1...56789...900

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
[\d-_:|\.]+[\d.]+\|([\w]+)
/

Description

dear all, i am a regex beginner, so please be gentle :)

we have lines of log contents delimited by a pipe char. is it possible to fetch the content between the 5th and the 6th delimiter, ignoring the values in between?

example log line: 2014-05-21_06:50:59|10.128.3.20|-|-|-|GET|/home.html|-|6

I'd like to do something like result = line.split('|')[6]. unfortunatelly I can't write code but only a regex selector.

help is highly appreciated.

Submitted by regexBeginner - 10 years ago