Skip to Content
Tableau Prep即学即用
book

Tableau Prep即学即用

by Carl Allchin
August 2022
Beginner to intermediate
463 pages
9h 22m
Chinese
China Electric Power Press Ltd.
Content preview from Tableau Prep即学即用
278
31
REGEXP_MATCH([
String Field
],'regex pattern')
31.3.2 REGEXP_REPLACE()
函数
REGEXP_REPLACE()
函数指定了要替换的字符串字段的一部分以及要替换的值。
REGEXP_REPLACE([
String Field
],'
Substring to replace
','
Replacement value
')
31.4 Regex
(正则表达式)应用案例
正则表达式所提供的灵活性使其可用于大量的场景。本节将介绍一些最常见的情况。
31.4.1
替换常见错误
许多字符串字段来自手工输入的文本。这可能意味着一个数据字段内包含了重复的错
误,在进行准确的分析之前需要将其删除。例如,如果你有已提取出的不同事件的时间,
但格式不同,你需要从字符串中提取相关的值,然后才能开始分析(见图
31-2
)。
31
-
2
:基本的时间字段
在这个例子中,需要从这个字符串中提取时间。图
31-3
展示了如何使用
REGEXP_
EXTRACT()
来实现这一目的。
31
-
3
:使用 REGEXP_EXTRACT() 函数提取时间
这将返回你需要的结果(见图
31-4
)。
279
使用正则表达式
31
-
4
:图
31
-
3
REGEXP_EXTRACT() 函数计算的结果 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

深度学习:核心原理与案例分析

深度学习:核心原理与案例分析

Posts & Telecom Press, Ahmed Menshawy
Python金融实战

Python金融实战

Posts & Telecom Press, Yuxing Yan
Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu
HBase管理指南

HBase管理指南

Posts & Telecom Press, Yifeng Jiang

Publisher Resources

ISBN: 9787519864439