Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Suggestions ➜ Regexp ^$

Regexp ^$

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Vaejor   (120 posts)  Bio
Date Thu 13 Jun 2002 12:55 PM (UTC)
Message
It appears as though the Regexp ^$ doesn't correctly match to an empty line.

Is it possible for it match correctly?
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 13 Jun 2002 09:53 PM (UTC)
Message
Which version are you using? I think there might have been a bug in an early version where blank lines didn't go through trigger matching or something like that. However I think it works now. Also, are you sure it is blank (try packet debug)? Maybe it has a space in it. You might need:

^[ ]*$

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Vaejor   (120 posts)  Bio
Date Reply #2 on Thu 13 Jun 2002 11:25 PM (UTC)
Message
I'm currently using version 3.22.

I checked the packets, and found only (the equivalent of)
chr(13) & chr(10) & chr(13) & chr(10)
in each position where I saw a blank line.

I also just tried ^[ ]*$ but that did not gag the empty lines.
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #3 on Fri 14 Jun 2002 01:29 AM (UTC)
Message
Ah yes, I remember now. :)

It didn't work a while ago, and because I thought someone might be relying on it, I made it an option, can't remember the exact reason. ;)

Go to:

File -> Global Preferences -> General

and check:

"Regular expressions can match on an empty string"

I think it is because it is an option inside the regular expression suboutines, that "no match" (ie. nothing at all returned) is considered "not a match", even in the case that you present, where you are specifically searching for an empty string. The option in question lets the regexp parser consider an empty string a match.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Vaejor   (120 posts)  Bio
Date Reply #4 on Fri 14 Jun 2002 01:48 AM (UTC)
Message
Ah, there it is.

Thanks, Nick.

Makes gagging the output from specific commands work fully now, so I can just use the information I've grabbed from them.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


15,334 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.