Regular Expressions 101

Community Patterns

Ending with New line or Blank Space

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?:\n|\s$)
/
gm

Description

this expression can be added to the end of a regular expression to match words which can end with NEW LINE or BLANK SPACE.

Submitted by J. V. L. Alves - 2 years ago