Help plz, Replace every 5th occurrence of full stop to a new line
-
Hi,
I want to replace every 5th occurrence of . to a new line, I tried using Replace text with regex using the below regex.Text string is
This is a test. In which I'm trying. To insert a newline character. After every 4th period. In a block of text. In order to build in some whitespace for epic textblocks.Regex
([^.]*.){5}
replace with
$0\nGetting the result
$0\n In order to build in some whitespace for epic textblocks.while it works fine here.
https://regex101.com/r/I5IMMa/1/plz anyone can help
-
@spa3212 said in Help plz, Replace every 5th occurrence of full stop to a new line:
Hi,
I want to replace every 5th occurrence of . to a new line, I tried using Replace text with regex using the below regex.Text string is
This is a test. In which I'm trying. To insert a newline character. After every 4th period. In a block of text. In order to build in some whitespace for epic textblocks.Regex
([^.]*.){5}
replace with
$0\nGetting the result
$0\n In order to build in some whitespace for epic textblocks.while it works fine here.
https://regex101.com/r/I5IMMa/1/plz anyone can help
Have you read the description of the action?
-
@Fox Hi, Thanks For your reply, actually I still not able to get it done, can you plz help knowing me how to do this.
-
@spa3212 said in Help plz, Replace every 5th occurrence of full stop to a new line:
@Fox Hi, Thanks For your reply, actually I still not able to get it done, can you plz help knowing me how to do this.
To replace only one occurrence of group of five, you need to exclude the quantifier group and add a common group
((?:[^.]*.){5})