Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

777not888's avatar

How do I write a regular expression?

The name needs to consist of A-Z a-z and symbols _ ( ) ! @ * . # / \

How to do it?

0 likes
1 reply
bugsysha's avatar
[A-Za-z_()!@*.#\/\]+

Or you can escape all chars

[A-Za-z\_\(\)\!\@\*\.\#\/\]+

Please or to participate in this conversation.