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 ➜ VBscript ➜ RegExp

RegExp

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


Posted by WRTIII   Canada  (76 posts)  Bio
Date Sun 11 Jan 2004 01:35 AM (UTC)
Message
I want a trigger that will match on an asterik.
but it has to accomendate varations of how the asterik is shown. ie.

*
/*
*\
/*\
p/*\
/*\p
p/*
*\p

In any case the asterik is always there

So What I need is

Match the * regardless of what is prior to or after it
in the case that something is prior to or after it


So I know ^\* will match an asterik
^ is start of line

so I guess I need ^*\**$ lol I am getting lost trying to follow all this regexp stuff


The other problem I am having may or may not time in with this...

*
You walk westwards.
Rue Esertudins.
The Rue Esertudins continues to the west. The Rue St. Opportune is to the
east. Nearby to your south is the entrance of The Frog and Peach. Nearby to
your south-west is the entrance of Pierre's House of Healing. You could
progress eastwards, westwards. You see two battle horses ahead of you.
* e
I do not understand.

right now I just have it set to color the lines it matches with is
You walk westwards.
and the * after the description

The first trigger enables the trigger to match the star
The trigger that matches the star turns itself off

The You walk westwards. matches perfectly
as for the asterik though (( I just made it match asterik only and am careful to keep it only at an asterik while I test until I get the correct regexp ))

But After the description shows the last thing to show is the * which is not colored

It does not color until I input something in this case I put in E then the asterik becomes colored ok just checked...
until I type something after the star shows up the 2nd trigger is still enabled... so when I move somewhere I get this...


* w
You begin to walk westwards.
*
You walk westwards.
Rue Esertudins.
The Rue Esertudins continues to the west. The Rue St. Opportune is to the
east. Nearby to your south is the entrance of The Frog and Peach. Nearby to
your south-west is the entrance of Pierre's House of Healing. You could
progress eastwards, westwards. In your immediate vicinity you see a battle
horse.
*

and it will sit like that with the last asterik and the trigger to match it not working until either the game or myself causes the next line to appear..

So I am not sure if it's the regexp causing that or if there is no hard return after the asteriks but I need that to activate right away otherwise the delay means I will be moving into the next room before the trigger evaluates the description.

wow a lot longer post than i meant it to be hopefully I gave enough info I have all the helpfiles I can find on this matter but still can't seem to get past it thanks
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 11 Jan 2004 04:07 AM (UTC)
Message
A regexp that will match an asterisk anywhere on a line?

Try this:

\*

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


10,565 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.