Jump to content

[SOLVED] Allow one space between words?


pianoman993

Recommended Posts

Hello there PHP experts. I have a small expression that checks to make sure the given string has Only alpha characters, digits, underline or dash characters. However, would it be possible to edit it to allow one space between words?

 

Here is what I've got:

'/^([a-z0-9])([a-z0-9_\-])*$/ix'

 

Example "Example String" (the expression allows one space between example and string)

 

An even more adventurous example: "Another Example String" Still allows a space between words

 

If anyone has any ideas please post!

Thank you for your time!

 

- Pianoman993

Link to comment
https://forums.phpfreaks.com/topic/145660-solved-allow-one-space-between-words/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.