[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

how to include a new pattern in regex

ok, in php regex how do you include a newline in your pattern?
0
acclarkEE
Asked:
acclarkEE
2 Solutions
 
Bob LearnedCommented:
\r\n

Bob
0
 
ZhaawZSoftware DeveloperCommented:
\n for newline, \r for carriage return. They're often used together as \r\n. To match both \n and \r\n (instead of matching only \r\n), you could use "\r?\n".
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now