this post was submitted on 25 Jun 2025
5 points (100.0% liked)

AutoHotkey

192 readers
1 users here now

founded 2 years ago
MODERATORS
 

My current script successfully deletes the first character in a string, unless that character is a newline (`n). Even trying to put m in front of (?) to attempt to make it multiline changes nothing:

Contents := RegExReplace(Contents, '(?)^.{0,1}')

Suppose the variable Contents is:

123
456

It'll delete 1, then 2, then 3 (if you call it 3 times), but then it will never make it past the line break and get stuck and won't reach 456. Any help would be appreciated! I'm a Regex newb, but I'm not glued to Regex by any means and would be happy to use any other function to be able to do this. I'm just hopefully trying to do it all in one line, though I will use two lines if it comes down to it.

you are viewing a single comment's thread
view the rest of the comments
[–] Flagstaff@programming.dev 4 points 1 week ago

Oh, man, I totally didn't know or must've forgotten about SubStr() all this time! Thanks, that does the trick!!