当前位置:网站首页>What is the function of the regular expression replaceAll() method?
What is the function of the regular expression replaceAll() method?
2022-08-05 09:32:00 【qq_25073223】
From:
The regular expression replaceAll() methodWhat function does it have?
The following author describes the function introduction of the replaceAll() method, as follows:
The function of the replaceAll() method: Use regular replacement to replace all the matched strings Syntax of the replaceAll() method: Pattern pattern = Pattern.compile("Regular"); //Generate regular expression Matcher matcher = pattern.matcher("regular 122 regular 88988"); //match character matcher.replaceAll("Java")); //replace character
Example:
package com.java265.other;import java.util.regex.Matcher;import java.util.regex.Pattern;public class testClass {/** Use of java265.com Pattern class*/public static void main(String[] args) {Pattern p = Pattern.compile("([a-z]+)");Matcher m1 = p.matcher("java265.com888888");Matcher m2 = p.matcher("java67");System.out.println(m1.replaceAll("Niu Niu"));System.out.println(m1.replaceAll("Niu Niu"));}}-----Run the above code, the following information will be output----Niuniu 265. Niuniu 888888Niu Niu 265. Niu Niu 888888
边栏推荐
- shell脚本实例
- 21 Days of Deep Learning - Convolutional Neural Networks (CNN): Weather Recognition (Day 5)
- Excuse me if you want to write data in mysql, with flink - connector - JDBC directly is ok, but I'm in the f
- 阿里云存储的数据库是怎么自动加快加载速度的呢www.cxsdkt.cn怎么设置案例?
- Example of Noise Calculation for Amplifier OPA855
- 无题二
- 无题十三
- 仿SBUS与串口数据固定转换
- MQTT X Newsletter 2022-07 | 自动更新、MQTT X CLI 支持 MQTT 5.0、新增 conn 命令…
- 【Excel实战】--图表联动demo_001
猜你喜欢
How to realize the short press and long press detection of the button?
CCVR eases heterogeneous federated learning based on classifier calibration
Creo 9.0 基准特征:基准轴
dotnet OpenXML parsing PPT charts Getting started with area charts
欧盟 | 地平线 2020 ENSEMBLE:D2.13 SOTIF Safety Concept(上)
干货!生成模型的评价与诊断
施一公:科学需要想象,想象来自阅读
自定义过滤器和拦截器实现ThreadLocal线程封闭
ECCV 2022 Oral 视频实例分割新SOTA:SeqFormer&IDOL及CVPR 2022 视频实例分割竞赛冠军方案...
开源一夏|OpenHarmony如何查询设备类型(eTS)
随机推荐
leetcode 剑指 Offer 10- I. 斐波那契数列
ECCV 2022 Oral Video Instance Segmentation New SOTA: SeqFormer & IDOL and CVPR 2022 Video Instance Segmentation Competition Champion Scheme...
2022.8.3
2022.8.3
Marketing Suggestions | You have an August marketing calendar to check! Suggest a collection!
Rotation of the displayed value on the button
PAT Grade B-B1020 Mooncake(25)
深度学习21天——卷积神经网络(CNN):服装图像分类(第3天)
leetcode points to Offer 10- I. Fibonacci sequence
How ali cloud storage database automatically to speed up the loading speed of www.cxsdkt.cn how to set up the case?
flink cdc支持从oracle dg库同步吗
Concurrent CAS
Creo 9.0 基准特征:基准轴
欧盟 | 地平线 2020 ENSEMBLE:D2.13 SOTIF Safety Concept(下)
请问如果想往mysql里面写数据,直接用flink-connector-jdbc就可以吧,可是我在f
19.服务器端会话技术Session
IDEA执行Test操作导致数据插入时出现了重复数据
CCVR eases heterogeneous federated learning based on classifier calibration
tensorflow.keras无法引入layers
ts/js function pass parameter with function writing