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自带的软键盘凑合凑合得了,又觉得那个软键盘太大了,所以自己实现了一个. 说一下实现的思路,其实没什么思路 界面就是 ...
随机推荐
- java中pojo、dao命名解释
POJO::POJO(Plain Ordinary Java Object)简单的Java对象,实际就是普通JavaBeans,是为了避免和EJB混淆所创造的简称. 使用POJO名称是为了避免和EJB ...
- 查看Win系统激活状态
Win键+R调出运行框,在运行框中输入cmd slmgr.vbs -dlv winver 回车后就能看到当前系统的版本 slmgr.vbs -dli 显示:操作系统版本.部分产品 ...
- m4, autoconf
http://www.gnu.org/software/m4/m4.html GNU M4 is an implementation of the traditional Unix macro pro ...
- 小米路由Mini刷Breed, 潘多拉和LEDE
1. 下载breed,地址 http://breed.hackpascal.net/ 2. 下载小米Mini的开发板rom, 地址 http://www1.miwifi.com/miwifi_down ...
- Spring 3整合Quartz 2实现定时任务三:动态暂停 恢复 修改和删除任务
前面我们已经完成了spring 3和quartz 2的整合以及动态添加定时任务,我们接着来完善它,使之能支持更多的操作,例如暂停.恢复.修改等. 在动态添加定时任务中其实已经涉及到了其中的一些代码,这 ...
- 根据自身经验总结的一个IT时间管理
2012-11-13 内容存档在evernote,笔记名"根据自身经验总结的一个IT时间管理"
- ceph-mon 代码解读
一.概述: ceph-mon代码必备知识:Paxos算法,参见此处 数据结构分析: monitor代码结构:
- 【Java】Swing中JTextPane中如何绘制行号
Oracle在JTextPane类中并没有直接提供显示行号的方法,所以这个功能应该由程序员自己来完成,笔者发现网上很多的显示行号的代码都存在一个问题,就是不准确,特别是在行数变多了以后. 笔者先贴出代 ...
- Spark+Hadoop+IDE环境搭建
下载地址:https://download.csdn.net/download/u014028392/8841545
- python学习笔记——爬虫中提取网页中的信息
1 数据类型 网页中的数据类型可分为结构化数据.半结构化数据.非结构化数据三种 1.1 结构化数据 常见的是MySQL,表现为二维形式的数据 1.2 半结构化数据 是结构化数据的一种形式,并不符合关系 ...