Bernardo Bernardo - 1 year ago 72
PHP Question

How to join two regex?

I have this two regex

/^[^+\x2f\s\x5c ]+$/ - don't accept slashes, + or white spaces

/(?!^\d+$)^.+$/ - Don't be only numbers


I would like to join them in one. How can I join them?

Answer Source

You can join them as:

^(?!^\d+$)[^+\x2f\s\x5c ]+$

RegEx Demo