Skip to content

[development/code] How does setOrUnsetHeadingWithLevel / runRegexReplaceAction work? #1874

Answered by harshad1
aisbergde asked this question in Q&A
Discussion options

You must be logged in to vote

So regexReplaceAction runs through a list of search and replace pairs and performs the replace for the first pattern it matches.

It is a way of expressing if - else if - else if with regex statements.

i.e.
if condition 1 matches do replace 1 and terminate
if condition 2 matches do replace 2 and terminate
....

regexReplaceAction will run this on every selected line while chunking the changes and maintaining selection properly etc etc.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by gsantner
Comment options

You must be logged in to vote
1 reply
@gsantner
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants