Skip to content
Advertisement

PHP preg_split, split at | and check for minimum 3 chars

I want to separate at the “|” and check the length to at least 3 characters

JavaScript

Can anybody help me? https://www.phpliveregex.com/p/AdQ

Advertisement

Answer

I think doing this in a regex might not be the best tool for the job, but if you want to use it here might be a possibility:

JavaScript

enter image description here

https://regex101.com/r/Pz3YCH/1

Again though, I think doing a string split would be much better though.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement