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自带的软键盘凑合凑合得了,又觉得那个软键盘太大了,所以自己实现了一个. 说一下实现的思路,其实没什么思路 界面就是 ...
随机推荐
- 转 安装php时报gd相关的错误(gd_ctx.c)
在安装php时,报如下错误 In file included from /kk/php-5.4.0/ext/gd/gd.c:103: /kk/php-5.4.0/ext/gd/gd_ctx.c: In ...
- 转:Ogre源码剖析 - 场景管理之Octree
由于本人的引擎ProjectGaia服务于08年创新杯的游戏项目 – 3D太空游戏,所以理所应当加入Octree(八叉树 – 已经周宁学长发帖介绍过)场景管理器.参考了无数Octree的代码,发现还是 ...
- android官方资料
android develop – Guides http://developer.android.com/guide/ android develop – API Reference http:// ...
- docker运行nginx为什么要使用 daemon off
再返回Nginx的docker仓库仔细查看说明,其实是有说明的 /捂脸- 就是在CMD后面加上exec nginx -g 'daemon off;',如下: command: /bin/bash -c ...
- yum安装nodejs 8
Install Node.js 8 on Enterprise Linux Distributions To install Node.js 8 on Enterprise Linux distros ...
- CSRF攻击与防御(写得非常好)
转自:http://blog.csdn.net/stpeace/article/details/53512283 CSRF概念:CSRF跨站点请求伪造(Cross—Site Request Forge ...
- ThinkPHP+jQuery EasyUI Datagrid查询数据的简单处理
ThinkPHP和jQuery EasyUI这两个都是不错的框架,现在要把它两个整合到一块,做个简单的Ajax调用查询. 在ThinkPHP模板中引入EasyUI的相关文件,然后设置按钮3的调用: & ...
- SpringBoot配置属性之MQ
SpringBoot配置属性系列 SpringBoot配置属性之MVC SpringBoot配置属性之Server SpringBoot配置属性之DataSource SpringBoot配置属性之N ...
- mongodb的serverstatus
MongoDB shell version: 2.0.5 connecting to: test { "host" : "TENCENT64.site", -- ...
- svn开发常用整理
1.删除tortoise svn中的账号信息 其实tortoise svn也是将账号信息存放在本地的配置文件中 在不同的操作系统下,操作基本类似,首先我们来看一下windows下如何操作的. 以win ...