拆分两个不同变体的字符串 [英] Split string for two different variants

查看:97
本文介绍了拆分两个不同变体的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些正则表达式的帮助。

我有一个CSV文件,其中包含一个包含联系人名称和列的列。电话号码(在一栏中)。我需要将它们分成两个单独的值。字段字符串可以是2种格式,例如:"ContactPersonName(000)123 4567"。或者"ContactPersonName 0001234567"。

有人可以帮我使用正则表达式将此字符串拆分为2吗?它应该在第一次出现时分开"("或"数字的第一次出现。

谢谢

解决方案

结果

Hi, I need some help with a regular expression.

I have a CSV file with a column that holds the Contact Person Name & Tellephone Number (in one Column). I need to split these into two seperate values. The Field String can be in 2 formats ex: "ContactPersonName (000) 123 4567" or "ContactPersonName 0001234567".

Can someone please help me with a Regex to split this string into 2? it should split on the first occurance of "(" or the first occurange of a number.

Thanks

解决方案

Hi,



这篇关于拆分两个不同变体的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆