当前位置:网站首页>Idea uses regular expressions for global substitution
Idea uses regular expressions for global substitution
2022-06-26 08:11:00 【Painted horse】
scene : The constant pool type of the initial code is set to int type , Later revised to Integer type , As a result, Alibaba code specification shows that == It is amended as follows .equals In the form of . But because of too much code . So we use the form of regular expression to globally replace .
Replaced code
mti == Mti.MSG0100
Need to replace with
Mti.MSG0100.equals(mti);
1. Use IDEA Shortcut key ctrl+shift+H, Open the following page 
2. choice Regex
3. Start writing regular expressions . My expression here is relatively simple .
(mti) == (Mti.MSG\d{
4})
This will simply match the replacement object I want .
4. According to the objects you match ,( Counting a bracket from front to back matches an object , That is to say $1)
To match the result you want to replace with .
$1.equals($2)
5. Click on Replace that will do 
边栏推荐
- Google Earth engine (GEE) 02 basic knowledge and learning resources
- Junit
- Can the warehouse management system help enterprises reduce storage costs
- Read excel table and render with FileReader object
- Pychart connects to Damon database
- 花指令wp
- What is the five levels of cultivation of MES management system
- Getting started with idea
- Flower instruction WP
- QT之一个UI里边多界面切换
猜你喜欢

What is Wi Fi 6 (802.11ax)? Why is Wi Fi 6 important?

Interview for postgraduate entrance examination of Baoyan University - machine learning

PyTorch-12 GAN、WGAN

MySQL practice: 1 Common database commands

Detailed explanation of the generate go file command of import in golang (absolute detail)

What are the characteristics of digital factory in construction industry

Livevideostackcon | evolution of streaming media distribution for online education business

Read excel table and render with FileReader object

JMeter performance testing - Basic Concepts

Chapter II (summary)
随机推荐
Double linked list -- tail interpolation construction (C language)
Macro task, micro task, async, await principle of interview
[UVM practice] Chapter 2: a simple UVM verification platform (5) build test cases
What are the key points of turnover box management in warehouse management
QT之一个UI里边多界面切换
PCB miscellaneous mail
Understanding of closures
JS Date object
Uniapp uses uviewui
Win10 mysql-8.0.23-winx64 solution for forgetting MySQL password (detailed steps)
Minor problems in importing D
1010. song backtracking with total duration divisible by 60
. eslintrc. JS configuration
Data governance: from top project to data culture!
Leetcode topic [array] -11- containers with the most rainwater
[issue 22] sheen cloud platform one side & two sides
Two models of OSPF planning: double tower Raider and dog tooth crisscross
Chapter 4 (functions and preprocessing)
"System error 5 occurred when win10 started mysql. Access denied"
Google Earth Engine(GEE) 01-中输入提示快捷键Ctrl+space无法使用的问题