Re: Pattern matching

new topic     » goto parent     » topic index » view thread      » older message » newer message

> I need to find IP in a string.
> Using wildcard_match() in wildcard.e 
> i.e wildcard_match("*.*.*.*", string) only return true or false.
> I want it to return position and if possible test if it is legal.

You could try tokenizing the string on '.' and checking the number of fields. 
You could use Kat's strtok.e for this:

http://www.tiggrbox.info/program/strtok-v2-1.html

There are also some regular expression libraries in the archives that could
probably be used.  Something like: /^(\d+\.){3}\d+$/ should work (assuming
Perl-compatible regexp).

Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu