|
Thunderbuster Novice
Joined: 07 Nov 2001 Posts: 45 Location: USA
|
Posted: Sun Aug 18, 2002 5:42 am
[?]123,456,789 Pattern matching |
How can you match a pattern like this and assign it to a varable. The best I am coming up with is &%dvar1,&%dvar2,&%dvar3 then I assign it like this: varable=@var1~,@var2~,@var3
I am certain there is a better way to capture the pattern and assign it to a varable. I am running into a problem when the number to match has this pattern 1,234,567,890. The leading 1 doesn't want to assign to varable, so I am looking to do it the correct way.
Thanks
2nd place just means your a 1st place loser. |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Sun Aug 18, 2002 5:46 am |
Try using %x:
#TRIGGER {coming up with is (%x) then I assign} {#VAR varable %1}
#SH coming up with is 1,234,567,890 then I assign
#SH I captured: @Varable
Ton Diening |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sun Aug 18, 2002 6:32 am |
Since you weren't very specific on the line you want to match then I must assume you want to generically match a number with commas in it. Try this.
#TR {([0..9,])} {varable="%1"} |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Aug 18, 2002 3:39 pm |
You can match the pattern with %n.
LightBulb
Senior Member |
|
|
|
LEit Novice
Joined: 27 Jul 2002 Posts: 38 Location: USA
|
Posted: Mon Aug 19, 2002 2:54 pm |
If you need to strip the ,'s you can use %replace(@var,",","")
|
|
|
|
|
|