dcsimg
Results 1 to 7 of 7

Thread: Is there a library that validates strings

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    Is there a library that validates strings

    Hi, is there a library that checks against the types I stated above? It doesn't matter if it's C# C++ another library. These are data types used by a download manager / bittorrent client.

    ADDR INTERFACE METALINK_FILE PID SIZE VALUE
    COMMAND INTERFACES METHOD POLL TAG VERSION
    DIGEST IPADDRESS METHOD PORT TOKEN [=SIZE],tail[=SIZE]
    DIR IPADDRESS[,...] MINUTES PORT... TORRENT_FILE [true|false]
    DSCP KEYWORD N PROTO TYPE [true|false|A:B]
    FILE LANGUAGE NUM PROXY TYPE plain|arc4
    GID LENGTH OPT RATIO URI true|false
    HEADER LEVEL OS REFERER URI[,...] true|false|mem
    HOST:PORT LOCATION[,...] PEER_AGENT SEC USER *
    INDEX... LOG PEER_ID_PREFIX SELECTOR USER_AGENT *

    EDIT: What I need is ex. if I want to validate against IPADDRESS these must return true;

    Code:
    string: 233.93.15.1 - returns true
    string: 353.93.15.1 - returns true
    string: 15.25       - returns false

    if I want it to validate DIR this must happen.

    Code:
    string: C:\Program Files\7-Zip\      - returns true
    string: D:\music\michael_jackson\ - returns true
    string: D/mp3           - returns false
    Last edited by nikel; Jul 4th, 2018 at 11:28 AM. Reason: I added more info
    I'm not a man of too many faces
    The mask I wear is one

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    100,010

    Re: Is there a library that validates strings

    I don't really understand the question. What "types"? Are you saying that you want to find one of those values in some text? Try providing a FULL and CLEAR explanation of the problem.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    Re: Is there a library that validates strings

    Hi, I edited my post.
    I'm not a man of too many faces
    The mask I wear is one

  4. #4
    Fanatic Member PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Newport, UK
    Posts
    860

    Re: Is there a library that validates strings

    Are you sure of that, string: 353.93.15.1 - returns true certainly isn't doing what I expect as that most definitely isn't a valid IP address....

    A lot of the other data types might need an explanation as well - exactly what is a GID or TOKEN supposed to look like?
    Last edited by PlausiblyDamp; Jul 4th, 2018 at 11:49 AM.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    Re: Is there a library that validates strings

    Hi I don't know all of them yet but I pasted an example GID at https://gist.github.com/onurcan19772...9c375aa594618b

    and some token:
    Code:
    e6c3778f-6361-4ed0-b126-f2cf8fca06db
    I'm not a man of too many faces
    The mask I wear is one

  6. #6
    Fanatic Member PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Newport, UK
    Posts
    860

    Re: Is there a library that validates strings

    Quote Originally Posted by nikel View Post
    Hi I don't know all of them yet but I pasted an example GID at https://gist.github.com/onurcan19772...9c375aa594618b

    and some token:
    Code:
    e6c3778f-6361-4ed0-b126-f2cf8fca06db
    If you are trying to work with .torrent files then a better understanding of the structure might be a starting point you might want to look at something like https://en.wikipedia.org/wiki/Torren...File_structure or http://www.bittorrent.org/beps/bep_0003.html

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    Re: Is there a library that validates strings

    Wikipedia is banned in my country, I have general knowledge about torrenting, of course I'll need to learn more about it. Thanks for your reply.
    I'm not a man of too many faces
    The mask I wear is one

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width