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自带的软键盘凑合凑合得了,又觉得那个软键盘太大了,所以自己实现了一个. 说一下实现的思路,其实没什么思路 界面就是 ...
随机推荐
- DLib压缩解压程序示例
/* 这是一个示例程序,使用了Dlib库的compress_stream和cmd_line_parser组件. 这个示例实现了一个简单实用的命令行压缩程序. 当使用-h选项时候,程序输出如下: 使用: ...
- 体验cygwin纪实
在windows快速体验linux,借助Cygwin很不错的体验(占用空间小),win10应用商店目前集成ubuntu.fedora...系统... 00.安装源,直接下载的是init(仅仅是下载器) ...
- uitableview 和UISearchBar 下拉提示结合使用
自定cell的代码 餐厅的实体和餐厅对应控件的frame #import <Foundation/Foundation.h> @class RestaurantFrame; @interf ...
- iOS之ProtocolBuffer搭建
一.环境安装:pb编译器的安装 1.从https://github.com/google/protobuf/releases下载protocolBuffer对应版本编译器包,比如目前的对应的objc最 ...
- 用ElasticSearch存储日志
介绍 如果你使用elasticsearch来存储你的日志,本文给你提供一些做法和建议. 如果你想从多台主机向elasticsearch汇集日志,你有以下多种选择: Graylog2 安装在一台中心机上 ...
- java 实现唯一ID生成器
2014-11-08 内容存档在evernote,笔记名"java 实现唯一ID生成器"
- Ubuntu下架设FTP服务器(转)
Ubuntu下架设FTP服务器 Linux下提供了很多的ftp服务器,这里我选用了安全,快速,简单的vsftpd作为FTP服务器.本文是我在自己的Ubuntu 10.10 -32 位系统下搭建的.搭建 ...
- POJ 3678 Katu Puzzle (经典2-Sat)
Katu Puzzle Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6553 Accepted: 2401 Descr ...
- 【Servlet】使用org.eclipse.jetty实现小型的Servlet服务器
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpSer ...
- java单双派机制理解
引言:Java是一个支持双分派的单分派语言 知道java是支持后期动态绑定,也知道访问者模式,但是两者之间的关系,还真不知道,况且在这之间还有一个静态绑定. 1.动态绑定 class Father { ...