Jump to content


Photo

regex for commas


  • Please log in to reply
4 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 16 June 2006 - 05:17 PM

I am trying to find some regular expressions to check for commas after each word, is there any you know of I tried google searches with no luck, and www.regular-expressions.info doesn't seem to have anything specific either.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 16 June 2006 - 06:33 PM

Commas after each word?
For what you'd need that? How exactly you want it to match? What is a "word"?
~ D Kuang

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 16 June 2006 - 06:35 PM

www.funnyemailforwards.com the keywords, I have to validate them to seperate by commas for the database don't I.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 16 June 2006 - 06:48 PM

you can use explode? which will split the keywords up into an array then you can validate each keyword one by one:
$keywords = explode(',', $_POST['keywords'];

foreach($keywords as $k => $v)
{
    //validate each keyword, $v stores the keyword.
}


#5 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 16 June 2006 - 07:35 PM

ahh, thanks I appreciate it.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users