 |
herbster69 Newbie
Joined: 20 Nov 2009 Posts: 8
|
Posted: Fri Nov 20, 2009 4:09 pm
Regular expression |
I'm having a problem with writing a regular expression for a prompt trigger I want to use.
Example of the text requiring triggering are
1234h, 2345m ae-
1234h. 2345m -
The following trigger matches the 1st 2 variables (1235 & 2345):
^([0-9]+)h, ([0-9]+)m
The problem I have is the character(s) or not, preceding the "-". ^([0-9]+)h, ([0-9]+)m ([A-z]+)- will capture the characters but only if any exist.
I would like to a trigger to match even if there is nothing preceding the -.
Once I get a value for the 3rd variable (it can include the - btw) I can then search within the variable for characters to determine what.
Thanks |
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Fri Nov 20, 2009 4:17 pm |
Code: |
#REGEX {^([0-9]+h, ([0-9]+)m ([A-z]+)?-} {Do whatever here. It will match %3 if it's there, and not bother the trigger if it's not there.} |
Charneus |
|
|
 |
herbster69 Newbie
Joined: 20 Nov 2009 Posts: 8
|
Posted: Fri Nov 20, 2009 4:20 pm |
excellent, thanks.
|
|
|
 |
|
|