Register to post in forums, or Log in to your existing account

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion

Joined: 23 Aug 2013
Posts: 175

PostPosted: Fri Mar 25, 2022 9:38 pm   

help with regular expsression

how do i turn that into a regular expression that will show just 1 or 100 of those ?


etc etc... it has too close of a pattern to use wildcard and picks up everything else in brackets. ~[(*)~]

it occurs in the middle of a pattern so it's not the beginning or end of a line and i tried this : ^~[(*)~]$

many thanks!
Reply with quote

Joined: 04 Aug 2002
Posts: 4677
Location: Pensacola, FL, USA

PostPosted: Fri Mar 25, 2022 11:49 pm   
Use the broad pattern, then test the resultant variable for the member you care about

#TR {~[(*)~]} {
  #IF (%ismember("GE", %1)) {do something}
  #IF (%ismember("TRS", %1)) {do something}
Discord: Shalimarwildcat
Reply with quote

Joined: 09 Apr 2008
Posts: 168

PostPosted: Sat Mar 26, 2022 5:05 am   
Going to assume you want to toggle certain ones on/off based on some criteria. I ended up just doing a blanket capture...
<trigger priority="1640" regex="true" id="2070">
  <pattern>C: \[(\w[^>]+)(K|M)] \[(\w[^>]+)]</pattern>
  <value>HUD.Credits = %1
HUD.Value = %2
HUD.ActiveImplants = %3

used in
<button type="Separator" autosize="false" width="200" height="33" autopos="false" left="0" top="-183" toolbar="4" color="black" textcolor="aqua" border="red" priority="603" id="2063">
  <caption>Active Implants [Max: @HUD.ActiveMax] %cr [ @HUD.ActiveImplants ]</caption>

this was ages ago when I was more active with Cyborg though...

also for Shalimar's trick enable 'repeat within line' option so it will grab all active implants.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by