使用正则表达式将字符串分成多列 [英] Break string into columns using Regular Expression
本文介绍了使用正则表达式将字符串分成多列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是正则表达式的新手,我想使用正则表达式将给定字符串分成 6 个部分.我正在使用 Pentaho 数据集成工具(ETL 工具)
I am new in regex, i want to break the give string into 6 parts using regular expression. I am using the Pentaho data integration tool (ETL tool)
给定字符串: 1x 3.5 mL SST.1x 4.0 mL 灰盖冷冻管.
Given string: 1x 3.5 mL SST. 1x 4.0 mL gray cap cryovial.
注意:有更多相同格式的字符串
Note: There are many more string with same format
我希望输出为:
提前致谢!!
推荐答案
您提供的 single 字符串数据看起来应该与正则表达式模式匹配:
The single string datum you've given looks like it should match the regex pattern:
(\d*)x\s(\d*\.\d*)\smL\s(.*)\.\s(\d*)x\s(\d*\.\d*)\smL\s(.*)\.
您可以将它与 Regex Evaluation
步骤一起使用:
You can use it with Regex Evaluation
step:
这篇关于使用正则表达式将字符串分成多列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文