Encerrado

PHP need Regular Expression

I need a regular expression that will take a line of words separated by spaces , '_' and or '-' and make an array of individual words.

RULES:

* words must be no shorter than 3 characters.

* words must not contain any characters except a-z, A-Z and 0-9.

* words should not be greater than 45 characters.

* words must not be 4 or less characters and all numeric.

* words that are greater than 4 character and all numeric are allowed to maintain '-'.

* There should be no spaces in front, back or middle of word.

The end result should be an array of words that match the rule criteria. If you can't do all those rules in one regular expression let me know what the best scenario is.

Example Sentence:

Easter Sweets Basketâ?'?“ Pink Jelly 14-inch 75-80322 Plush Bear - Peanut Butter_Brown 6885 ReddingFullLengthDSet257RobertsLengthDSet257Roberts

This is what I have so far below. It just makes sure words are greater than 3 characters long.

preg_match_all('([\w]{3,})',$product_row,$matches);

Habilidades: Engenharia, MySQL, PHP, Gestão de projetos, Arquitetura de software, Teste de Software, Hospedagem Web, Gestão de Site , Teste de Website

Ver mais: regular expression match word, match management, example regular expression, regular expression example, sweets, regular, plush, peanut, expression, easter, php expression, regular words, project bear, individual characters, project scenario, project management scenario, regular expression php, codebuyer101, php regular expression, individual regular, words rules, project regular expression, need regular, project example php, sentence word project

Acerca do Empregador:
( 162 comentários ) Oakland Park, United States

ID do Projeto: #3000641

13 freelancers estão ofertando em média $30 para este trabalho

newgroup4u

See private message.

$12.75 USD in 14 dias
(132 Comentários)
7.4
mkowalczuk

See private message.

$42.5 USD in 14 dias
(27 Comentários)
5.8
toinnisfreesl

See private message.

$42.5 USD in 14 dias
(37 Comentários)
5.3
rogersilverstone

See private message.

$17 USD in 14 dias
(126 Comentários)
5.0
dennis1978vw

See private message.

$24.65 USD in 14 dias
(40 Comentários)
4.4
billyhandiii

See private message.

$12.75 USD in 14 dias
(24 Comentários)
4.2
Flowzone

See private message.

$12.75 USD in 14 dias
(12 Comentários)
3.9
webexpresszone

See private message.

$59.5 USD in 14 dias
(7 Comentários)
4.0
vw7346251vw

See private message.

$12.75 USD in 14 dias
(16 Comentários)
3.7
homi12345

See private message.

$8.5 USD in 14 dias
(9 Comentários)
2.7
alienwebsl

See private message.

$72.25 USD in 14 dias
(6 Comentários)
2.7
raczvw

See private message.

$21.25 USD in 14 dias
(2 Comentários)
0.9
bmichaud

See private message.

$51 USD in 14 dias
(0 Comentários)
0.0