regex - 带数字的 CSV 正则表达式

我正在寻找一些正则表达式来帮助解析我的 CSV 文件。

文件有几行

number,number
number,number
Comment I want to skip
number,number
number,number

例如:

319,5446
564425,87
Text to skip
27,765564

我将每一行读入一个字符串,我想使用一些正则表达式来确保该行与 (number,number) 的模式相匹配。如果不是,则不要使用该线路。

最佳答案

这是一种解决方案:

^\d+,\d+$

https://stackoverflow.com/questions/3040741/

相关文章:

delphi - 用Delphi如何获取当前安装的IE版本?

c# - 使用 Web 应用程序管理定时事件的首选方法是什么?

php - 使用php过滤掉数组中的重复值

iphone - CFBundleExecutable 错误

php - 不同 php 版本上的不同 sha1 校验和?

objective-c - 如何使用可为空的 int 或 NSInteger 指针?

.net - 来自非托管代码的 System.AccessViolationException?

iphone - 如何确保浮点值始终是 0.25 的倍数?

ios-simulator - class_getClassMethod 通常返回 nil(似乎只适

python - 获取当前日期作为方法的默认参数