当前位置:网站首页>Use replace regexp to add a sequence number at the beginning of a line
Use replace regexp to add a sequence number at the beginning of a line
2022-07-26 17:24:00 【Flying watermelon】
Suppose there is the following text
Google
Facebook
AmazonYou need to add a numerical sequence number at the beginning of the line , Become the following effect , What's a good way to ?
1. Google
2. Facebook
3. Amazonreplace-regexp This effect can be easily achieved :
M-x replace-regexp RET ^ RET \,(1+ \#). RET
Explain it. :
• ^ To match the beginning of a line
• \,(1+ \#). Replace with \, At the beginning, it means that this is a ELisp expression , among \# Indicates the current number of replacements , The default from the 0 Start , So I used 1+
Change the demand , If it is not a numerical serial number , It's the alphabet number , What can I do ?
a. Google
b. Facebook
c. Amazon Replace with \,(char-to-string (+ ?a \#)). that will do .
边栏推荐
- Recurrence of historical loopholes in ThinkPHP
- How to ensure cache and database consistency
- Linear regression from zero sum using mxnet
- SQL注入(思维导图)
- maximum likelihood estimation
- 现在网上开户安全么?股票开户要找谁?
- PXE高效批量网络装机
- Methods of path related comments (I)
- Implement softmax classification from zero sum using mxnet
- 办公软件常用快捷键大全
猜你喜欢

In May, 2022, video user insight: user use time increased, and the platform achieved initial results in cost reduction and efficiency increase

The principle of reliable transmission in TCP protocol

操作系统迁移实战之在openEuler上部署MySQL数据库

FIR filter design

【飞控开发基础教程1】疯壳·开源编队无人机-GPIO(LED 航情灯、信号灯控制)

Pyqt5 rapid development and practice 3.4 signal and slot correlation

On the evolution of cloud native edge computing framework

(24)Blender源码分析之顶层菜单显示代码分析

Packet capturing and streaming software and network diagnosis

Speaker recruitment | AI time recruit icml/ijcai 2022 as a Chinese speaker!!!
随机推荐
Establishment of Eureka registration center Eureka server
Thoroughly uncover how epoll realizes IO multiplexing
Thinkphp历史漏洞复现
Packet capturing and streaming software and network diagnosis
Redis persistence - detailed analysis of RDB source code | nanny level analysis! The most complete network
FIR filter design
Xiaomi Wuhan headquarters building starts today! Lei Jun: planned according to the scale of 10000 people
Week 4 Recurrent Neural Networks
Reuse idea through registry
[ctfshow web] deserialization
Quickly learn to configure local and network sources of yum, and learn to use yum
In the first half of the year, sales increased by 10% against the trend. You can always trust Volvo, which is persistent and safe
How can win11 system be reinstalled with one click?
The principle of reliable transmission in TCP protocol
How does win11 automatically clean the recycle bin?
浅谈云原生边缘计算框架演进
【飞控开发基础教程3】疯壳·开源编队无人机-串口(基础收发)
[Luogu cf643f] bears and juice (conclusion)
[classification] vgg16 training record
How to use different tools to analyze and optimize code performance when CPU utilization is high