当前位置:网站首页>What is the function of the regular expression replaceFirst() method?
What is the function of the regular expression replaceFirst() method?
2022-08-05 09:32:00 【qq_25073223】
From:
The regular expression replaceFirst() methodWhat function does it have?
The following author describes the function introduction of the replaceFirst() method, as follows:
The function of the replaceFirst() method: Use regular replacement to match the first matched string. The syntax of the replaceFirst() method: Pattern pattern = Pattern.compile("regular"); //Generate regular expression Matcher matcher = pattern.matcher("regular 122 regular 88988"); //match character matcher.replaceFirst("Java")); //replace characterExample:
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 pattern = Pattern.compile("regular"); //Generate regular expressionMatcher matcher = pattern.matcher("regular 122 regular 88988"); //match charactersSystem.out.println(matcher.replaceFirst("Java")); // replace character}}------Run the above code, the following information will be output-----Java122 regular 88988边栏推荐
- Weekly Report 2022-8-4
- 【LeetCode】623. Add a row to the binary tree
- Why do I recommend using smart async?
- Undefined symbols for architecture arm64解决方案
- CPU的亲缘性affinity
- 欧盟 | 地平线 2020 ENSEMBLE:D2.13 SOTIF Safety Concept(下)
- 干货!生成模型的评价与诊断
- 自定义过滤器和拦截器实现ThreadLocal线程封闭
- 【零基础玩转BLDC系列】无刷直流电机无位置传感器三段式启动法详细介绍及代码分享
- 请问大佬们 ,使用 Flink SQL CDC 是不是做不到两个数据库的实时同步啊
猜你喜欢

汇编语言(8)x86内联汇编

Assembly language (8) x86 inline assembly

Weekly Report 2022-8-4

CVPR 2022 | 将X光图片用于垃圾分割,港中大(深圳)探索大规模智能垃圾分类

The technological achievements of Shanghai Konan were selected into the "2021 Shanghai Network Security Industry Innovation Research Achievement Catalog" by the Municipal Commission of Economy and Inf

Custom filters and interceptors implement ThreadLocal thread closure

Seata source code analysis: initialization process of TM RM client

干货!生成模型的评价与诊断

Overall design and implementation of Kubernetes-based microservice project

Two-table query average grouping in sql server
随机推荐
无题十
leetcode 剑指 Offer 10- I. 斐波那契数列
MySQL内部函数介绍
2022-08-01 回顾基础二叉树以及操作
轩辕实验室丨欧盟EVITA项目预研 第一章(四)
无题十二
HStreamDB Newsletter 2022-07|分区模型优化、数据集成框架进一步完善
手写柯里化 - toString 理解
链表中的数字相加----链表专题
There is only one switch, how to realize the nqa of master-slave automatic switching
无题十三
PAT乙级-B1019 数字黑洞(20)
(转)[Json]net.sf.json 和org.json 的差别及用法
The technological achievements of Shanghai Konan were selected into the "2021 Shanghai Network Security Industry Innovation Research Achievement Catalog" by the Municipal Commission of Economy and Inf
Creo 9.0 基准特征:基准点
Creo 9.0 基准特征:基准坐标系
Pytorch深度学习快速入门教程 -- 土堆教程笔记(三)
基于 Kubernetes 的微服务项目整体设计与实现
PAT Class B-B1019 Digital Black Hole (20)
eKuiper Newsletter 2022-07|v1.6.0:Flow 编排 + 更好用的 SQL,轻松表达业务逻辑