You are here: Re: regular expression for comma-delimited pairs « PHP Programming Language « IT news, forums, messages
Re: regular expression for comma-delimited pairs

Posted by Curtis on 02/13/07 07:14

Bosconian wrote:
> I have a textarea form field for inputting (or pasting) pairs of data.
>
> I need a regular expression pattern to validate each line for the following
>
> double quote
> number
> double quote
> comma
> double quote
> alpha string
> double quote
> carriage return
>
> The following comes close, but doesn't check for a carriage return at the
> end of each line:
>
> ^"([0-9]?)+"([,]\s?\"([A-Za-z0-9]+)")*$
>
> For example the following would return true:
>
> "1","John"
> "2","Paul"
> "3","George"
> "4","Ringo"
>
>
> Any suggestions would be appreciated.
>
>

Try the /s modifier. Perhaps a bit "tipsy" to examine the regex in depth.

Curtis

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация