Forums Register Login

using wildcards in java

+Pie Number of slices to send: Send
hi,

i have been going through the java regular expression manuals.
all i need to do is to check if the entered sip id is correct or not.

for example:

there will be a sip id like ( sip:bharani@192.168.110.120 )

i need to check whether the entered value is in that format.

how can i check that.

i googled it, i got examples for how to check of the id is between 255.255.255.255 but not for checking the format.


kindly help


thanks in advance
+Pie Number of slices to send: Send
Hi bharani,

Test this

sip:[a-z,A-Z]*@\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b


This may work for you
+Pie Number of slices to send: Send
Welcome to JavaRanch, Vaib Saxena
+Pie Number of slices to send: Send
Thanks Campbell Ritchie ....
+Pie Number of slices to send: Send
thank you vaib.

i will try and let you know the status..




thank you
+Pie Number of slices to send: Send
hi vaib,

i'm new to java.
can you just tell me how to implement that.

should be that in a seperate method or in a class.
should i import anything to make it work.

i have to check if the entered address is of that form.

how to proceed.

thanks in advance
+Pie Number of slices to send: Send
 

bharani rao wrote:can you just tell me how to implement that.


Check out java.util.regex.Pattern and java.util.regex.Matcher. Or perhaps easier, java.lang.String#matches(java.lang.String).
+Pie Number of slices to send: Send
thank you rob..
We don't have time for this. We've gotta save the moon! Or check this out:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 914 times.
Similar Threads
making phone call using SIP
Date Validation
How to pass input values to the JSP using POST method
How to pass input values to the JSP using POST method
Validate IP address
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 06:16:52.