mIRC Home    About    Download    Register    News    Help

Print Thread
A
AD1C
AD1C
A
I am working on a script that parses the data in strings like this:

(W6RK-Bot) spot: W6JTI Humboldt, CA (fixed) 28043.3 CW

I want to locate the number in the string, i.e. 28043, and check to see if it's within a numerical range (ie. 28000-29700). I looked at isin() and iswc() but neither seems to be sufficient for my needs. The string above is an example, there can be more/fewer words both before and after the number. How can I do this?

Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
Code:
noop $regex($1-,/ (\d+)/)
if ($regml(1) isnum 28000-29700) {

A
AD1C
AD1C
A
Will this also work?

noop $regex(%spotline,/ (\d+)/)
if ($regml(1) isnum 28000-29700) {

Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
Yes, it'll work if the variable %spotline contains the string you want to match. The regex will catch the number before the decimal point and then compare it to see if it's within the range 28000 to 29700, as shown. I don't know what your actual script looks like. The example I've come up with above is merely based on your description.

A
AD1C
AD1C
A
It's all working fine, thanks.


Link Copied to Clipboard