|  | 
	
	
		| Leyline Wanderer
 
 
 Joined: 03 Feb 2007
 Posts: 64
 
 
 | 
			
			  |  Posted: Wed May 06, 2009 12:49 pm 
 Using Zmud trigger parse expressions...  {item|item|item}
 
 |  
				| is there a way to check for something like space, or no space? I want to make triggers with optional params, but I would like to not use (*)
 
 ie:
 @leader: assist
 @leader: assist joe
 
 I would like to write something like
 @leader:{ |}(%w)   or @leader:{ (%w)|}
 ([space]word|[or nothing])
 |  | 
	
	  |  | 
	
		|  | 
	
		| Leyline Wanderer
 
 
 Joined: 03 Feb 2007
 Posts: 64
 
 
 | 
			
			  |  Posted: Wed May 06, 2009 12:55 pm 
 |  
				| I guess I could settle for regex, 1 space 1 word optional... but since I am not using any regex I wanted to keep everything uniform.
 |  | 
	
	  |  | 
	
		|  | 
	
		| Fang Xianfu GURU
 
  
 Joined: 26 Jan 2004
 Posts: 5155
 Location: United Kingdom
 
 | 
			
			  |  Posted: Wed May 06, 2009 5:01 pm 
 |  
				| There's an option, somewhere, to enable wildcards inside {item|item}. It's disabled by default. 
 However, there are some things that regex is simply better at. Why not use it where it's useful?
 |  | 
	
	  |  | 
	
		|  | 
	
		| Leyline Wanderer
 
 
 Joined: 03 Feb 2007
 Posts: 64
 
 
 | 
			
			  |  Posted: Thu May 07, 2009 2:28 am 
 |  
				| Oh well, I've had like thousands of lines of zmud script dating all the way back to the early 90's regex I don't know existed back then...
 and I'm not so great at regex so...
 I was just saying,
 
 I don't  so much need wildcards inside lists, (it should be on)
 but what I want is...
 a trigger, that accepts params optionally,
 but if I code in for the space, the space is required...
 
 so
 @leader: heal
 or
 @leader: heal joe
 
 where heal would default the spell target to myself.
 the heal joe would heal joe...
 if I do
 #trig {@leader: heal (%w)}
 the word is optional (%1 will be empty)
 but the space between is not...
 
 
 I said I will throw some regex in here if I have to, I just wondered if there was a zmud syntax to do it,
 { |""} doesn't work,  etc.
 |  | 
	
	  |  | 
	
		|  | 
	
		| Fang Xianfu GURU
 
  
 Joined: 26 Jan 2004
 Posts: 5155
 Location: United Kingdom
 
 | 
			
			  |  Posted: Thu May 07, 2009 9:03 am 
 |  
				| {whatever|} should work - but if not, just use a regex. You can learn about them here. 
 |  | 
	
	  |  | 
	
		|  | 
	
		|  | 
	
		|  |