Regular Expressions 101

Community Patterns

Parse Ja or Nei with positive lookahead

0

Regular Expression
PCRE (PHP <7.3)

/
(Ja):\s*(?=x|\?|.*ja)|(Nei):\s*(?=x|\?|n)
/
gm

Description

Parse a Ja or Nei answer from a prompted response

Submitted by anonymous - 4 years ago