DOUHAO
https://www.java-forums.org/new-java/42610-java-regular-expressions-comma-seperated-list.html
https://stackoverflow.com/questions/14166149/regex-for-comma-separated-values
https://blog.oio.de/2012/08/23/split-comma-separated-strings-in-java/
https://dzone.com/articles/regular-expression-to-validate-a-comma-separated-l
Hi there guys,
I'm new to these forums but basically I have a little query about regular expressions.
Basically I have a project where I load in a text file containing an unlimited length of comma separated list of strings where the last string doesn't have a comma at the end of it.
e.g.:
johnny,matinay,crazy,rampage,eastpak,ghghg
All I want to do is to create a regular expression that will ensure that there is a comma separated list of strings where in each string there are alphanumeric characters, the "&" sign and white space but NO commas inside the string (since that is what the list is split with), so if the above list was changed to "johnny,matinay,,rampage,eastpak,ghghg" where there is one comma straight after the other then the regular expression would pick this up and throw an error.
All I have so far is:
[^,]+[,].+
But i'm not sure where to go from there.
Thanks in advance guys!
[^,]+[,].+
DOUHAO的更多相关文章
- 表达式求值(河南省第四届ACM试题-C题)题解
以防万一,题目原文和链接均附在文末.那么先是题目分析: [一句话题意] 给定指定的一个由3种函数组成的表达式,计算其数值. [题目分析] 一开始以为是后缀表达式,后来抽了没想出来,最后用了递归的方法解 ...
- python3入门之print,import,input介绍
本节主要介绍print,import和input,t函数,包括他们在python2.7和python3 的区别以及用法.下面附有之前的文章: python3的print函数的变化 python3之 ...
- WPF实现软键盘
wpf 实现一个软键盘, 先发个图: 工作有需要实现一个软键盘,本来想用windows自带的软键盘凑合凑合得了,又觉得那个软键盘太大了,所以自己实现了一个. 说一下实现的思路,其实没什么思路 界面就是 ...
随机推荐
- jenkins里面使用批处理命令进行自动部署
http://blog.csdn.net/hwhua1986/article/details/47974047
- Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境
使用Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境(一) 2015-01-14 20:28 by 飘扬的红领巾, 4322 阅读, 5 评论, 收藏, 编辑 ...
- 转:折腾一晚上Bullet及Ogre相关工具的成果 -- 3Ds Max,Maya, blender, GameKit
起始目的很简单,整合Bullet及Ogre,找个能够生成.scene和.bullet文件的建模工具. 折腾一晚上Bullet及Ogre相关的东西,基本上就像爱迪生发明灯泡一样,得出了N个失败的教训,总 ...
- Spring MVC 教程,快速入门,深入分析[1-11]
资源下载: Spring_MVC_教程_快速入门_深入分析V1.1.pdf SpringMVC核心配置文件示例.rar 作者:赵磊 博客:http://elf8848.iteye.com ...
- 给定数组a[1,2,3],用a里面的元素来生成一个长度为5的数组,打印出其排列组合
给定数组a[1,2,3],用a里面的元素来生成一个长度为5的数组,打印出其排列组合 ruby代码: def all_possible_arr arr, length = 5 ret = [] leng ...
- magento注册
1. 地址保存 $_custom_address = array ( 'firstname' => 'Branko', 'lastname' => 'Ajzele', 'street' = ...
- openstack nova 深入
一.概述: 由nova --debug list查看到: #nova --debug list DEBUG (session:195) REQ: curl -g -i -X GET http://19 ...
- win7系统总是安装不了net2.0的解决方法
一些网友询问说ghost win7系统总是安装不了net2.0怎么办呢?net2.0是什么?ATI显卡的控制中心 就需要在NET2.0的基础上.可是一些用户说win7系统总是安装不了net2.0如何解 ...
- block(五)用法
最近又从网上找了点block用法的博客,供大家参考. Block简介: Block的实际行为和Function很像,最大的差别是在可以存取同一个Scope的变量值.Block实体形式如下: ^(传入参 ...
- Linux系统排查——CPU负载篇
本随笔介绍CPU负载的排查手段. 查看系统负载的工具:uptime,w,都能查看系统负载,系统平均负载是处于运行或不可打扰状态的进程的平均数, 可运行:运行态,占用CPU,或就绪态,等待CPU调度. ...