Jump to content

preg_match_all with minus numbers


adamyork

Recommended Posts

I'm only just starting to learn how to use this function, but here is my code:

 

preg_match_all('/((?:[a-z]\w*\s?-*)+|(?:\d+))(?:\s+|$)/i',$team,$matches);

 

As far as I know, this is looking for letters/words, numbers and white spaces.

 

But as well as matching numbers I want it to find minus numbers.

 

Can anyone help me alter my code correctly please?

Link to comment
https://forums.phpfreaks.com/topic/227165-preg_match_all-with-minus-numbers/
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.