When I do regex:
find: ^a
replace: (no character, blank)
on file with:
aaaaa
It replaces all the a's, not just the first one.
I want to replace only the first a, it used to work on textpad.
Not sure why it is not working now.
replacing first character of line only
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
TextPad removes the a at the beginning of the line. The next a is now at the beginning of the line, so TextPad removes that. And so on. Perhaps TextPad shouldn't behave like this.
There are several ways to solve this. Here are two:
There are several ways to solve this. Here are two:
Find what: ^a(.*)
Replace with: $1
Find what: ^a(?=.|$)
Replace with: [nothing]