Hello,
I am editing a text file.
I want to find each line ending with the char dot - "."
and replace only the dot by space or delete it.
I do not want to delete dot in the middle of a line.
I have tried do replace F8 with regex
I did find the correct lines by putting .*\. in field "find what"
but could not find what string to put in field "replace with"
I need help
Thank you
Lezero Gan
REGEX LAST CHAR
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Re: REGEX LAST CHAR
Find:
Replace with: whatever you want - either a space or nothing at all. Yes: "replace" can also be left empty.
Explanation:
Code: Select all
\.$
Explanation:
- \. = Find a literal dot. This has to be preceded by a backslash, because the dot alone in a regex has the meaning of "any character".
- $ = At the end of the line.
Last edited by AmigoJack on Wed Feb 15, 2023 11:18 am, edited 1 time in total.
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
Re: REGEX LAST CHAR
You need to anchor the match at the end of the line by using the special regex symbol, "$":
Edit: Snap!Find what: \.$
Replace with: [space or nothing]