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自带的软键盘凑合凑合得了,又觉得那个软键盘太大了,所以自己实现了一个. 说一下实现的思路,其实没什么思路 界面就是 ...
随机推荐
- Aggressive cows
总时间限制: 1000ms 内存限制: 65536kB 描述 Farmer John has built a new long barn, with N (2 <= N <= 100,00 ...
- Windows开机BIOS启动快捷按键
Window装系统,开机需要调整启动选项...不同的机型,进入BIOS按键不同 按键列表
- ASP.NET之通过JS向服务端(后台)发出请求(__doPostBack is undefined)
ASP.NET回发数据是通过函数__doPostBack来实现的.该函数在加入了服务端控件,并将AutoPostBack设置为true之后,将自己主动生成,详细能够參看以下的图. watermark/ ...
- windows常用命令行整理
Windows虽然以GUI界面为主,但有时命令行也起到了很大的作用,下面就介绍几个常用.常见的windows命令行命令 1.ping 功能:用来测试数据包能否通过IP协议到达特定主机.即测试本机与特定 ...
- EntityFramework 5.0 CodeFirst 教程02-删除和修改/架构改变异常的处理
-----------------------------------------------------目录--------------------------------------------- ...
- CSS特效(弧光效果)
代码很简单, 根据需要修改标签class和弧光效果的宽高位置就可以了. <!DOCTYPE html> <html lang="en"> <head& ...
- 事务的四个属性ACID
事务四大特征:原子性,一致性,隔离性和持久性. 1. 原子性(Atomicity) 一个原子事务要么完整执行,要么干脆不执行.这意味着,工作单元中的每项任务都必须正确执行.如果有任一任务执行失败,则整 ...
- Java获取函数参数名称
原理 编译之后的class文件默认是不带有参数名称信息的,使用 IDE 时,反编译jar包得到的源代码函数参数名称是 arg0,arg1......这种形式,这是因为编译 jar 包的时候没有把符号表 ...
- 安装和使用solr
下载Solr:wget http://apache.fayea.com/lucene/solr/6.4.1/solr-6.4.1.tgz解压:tar -zxvf solr-6.4.1.tgz bin/ ...
- 【ASP.NET】Layout使用详解
1.母板页_Layout.cshtml 类似于传统WebForm中的.master文件,起到页面整体框架重用的目地 1.母板页代码预览 1 <!DOCTYPE html> 2 <ht ...