Regular expression for the IP address fails

415 pts.
Tags:
AS/400 IP address
Regular expressions
hi all, 
I'm trying to validate the IP address with the most accurate regular expression that I found in internet, I have fail in every try that I have , so , below is the first part of the regular expression and should not fail with a single number between 0 - 255, but fails , it looks to me that there is some error in the regular expression syntax(c program, v6r1), Could you point me please in the right direction?: 
 const char* myregex = "\(2[0-4][0-9]|2[0-4][0-9]|[01]?[0-9][0-9]?\)" ;  
 reti = regcomp(&ex, myregex, REG_NOSUB ) ; 
 reti = regexec(&ex, "4" , 0, NULL, 0);      
 printf ( "reti : %d n" , reti ) ;     // returns  1


Software/Hardware used:
v6r1, c program,

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following