How to achive IP address validation for Taxteditor?

I am using TextEditor for taking input which is IP address. How should i validate ip address that user hasn't entered a invalid ip address.? Is there any function exist in juce Liabrary for that.? Thanks in advance..

No.. Haven't got anything to parse IP addresses, I'm afraid.

Thanks TheVinn that worked.

Hi guys,
my apologies for necroing this old thread.
Any chance you could post the code for your validation? The link is dead.

No need to add externals any longer:

But looking at the code, I have no idea what happens, if the string is not a valid ip address…


Ah nice, didn’t notice there was an IPAddress class.

Yes, seems like an isValid() method could be helpful.
I suppose I can something like this, though it feels dirty:

TextEditor::Listener::textEditorFocusLost(TextEditor& myTextEditor)
	IPAddress ip = IPAddress(myTextEditor.getText());
	if (ip.toString() == myTextEditor.getText())
		// Entered IP address is valid.
		// ...