[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Multiline trigger.
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Multiline trigger.

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


Posted by Poromenos   Greece  (1,037 posts)  [Biography] 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!
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] 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.
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] 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!
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] 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!
[Go to top] top

Posted by Nick Gammon   Australia  (21,407 posts)  [Biography] 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
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] 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!
[Go to top] 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.


3,493 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]