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, 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.
 Entire forum ➜ MUSHclient ➜ General ➜ Multiline trigger.

Multiline trigger.

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


Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Mon 29 Nov 2004 10:57 AM (UTC)
Message
I am trying to match:
The six sided die rolls out onto the ground and the result is... 1
The six sided die rolls out onto the ground and the result is... 5

Why won't this work?
^The six sided die rolls out onto the ground and the result is\.\.\. (\d)\nThe six sided die rolls out onto the ground and the result is\.\.\. (\d)\z

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Mon 29 Nov 2004 03:24 PM (UTC)

Amended on Mon 29 Nov 2004 03:26 PM (UTC) by Flannel

Message
The RegExp parser hates you...

Err, Really... Dont you need the second \n? (before \z)

Edit: Yep, that seems to work for me.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #2 on Mon 29 Nov 2004 07:39 PM (UTC)
Message
Bah, thanks. I never would have guessed, I thought \z would be enough.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #3 on Mon 29 Nov 2004 07:42 PM (UTC)
Message
By the way, helpfile:
Quote:

A simple example would be to match on:

You are hungry.
You are thirsty.

To match this you might have the regular expression:

Match: ^You are hungry\.\nYou are thirsty\.\z

Doesn't this need to be changed too?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Nick Gammon   Australia  (23,062 posts)  Bio   Forum Administrator
Date Reply #4 on Mon 29 Nov 2004 08:09 PM (UTC)

Amended on Mon 29 Nov 2004 09:01 PM (UTC) by Nick Gammon

Message
OK, changed it for the next release.

I remember now why the example is wrong. Initially multi-line triggers put a newline *between* lines but not after the final line. That was when I wrote the example. However that made it hard to match on (line A|line B) both of which might end in a newline. So now there is a final newline, which you have to put in the regexp.

I have reworked the other examples on that help screen as well to make them work.

BTW are your fonts working now?

- Nick Gammon

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

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #5 on Mon 29 Nov 2004 10:09 PM (UTC)
Message
Yes, perfectly. They do require that I open the fonts dialog and click ok for every world then save, but that's not too much of a hassle. I suppose I could use sed to do it on them all at once.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
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.


14,830 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.