Regular expression for web page

Posted by Prakash2906 under Regular Expressions on 7/30/2012 | Points: 10 | Views : 1666 | Status : [Member] | Replies : 4
Guys,
Please see if you can help me with this since i have been trying to fix it for few days..thanks...

Ckt ID: Will be in the format "ww.xxxx.yyyyyy.zzzz". The y values can be anywhere from 1-6 digits. Ww is digit. Xxxx is alphanumeric. Zzzz is alpha.

Host name: Will probably be "mes-xxx-1234-main-st"; where xxx = the customer code. Max 25 Characters.

--P




Responses

Posted by: CGN007 on: 7/31/2012 [Member] Silver | Points: 25

Up
0
Down
Please refer http://regexlib.com/

Prakash2906, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mallesh on: 7/31/2012 [Member] Starter | Points: 25

Up
0
Down
HI
for Ckt ID purpose you have to try this regex as

\b \d[0-9]{1,2}+\.\w[A-Za-z0-9]+\.\d[1-6]{1,6}+\.\w[A-Za-z]{1,4} \b 


and for Host name:

\b mes-+[0-9A-Za-z.+_- ...]{1,25}+-1234-main-st  \b 


I think it's useful for you.

Try that if any problem make a post here.


== Mallesh

Prakash2906, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prakash2906 on: 8/1/2012 [Member] Starter | Points: 25

Up
0
Down
thank you very much. I also need reg ex for
ss:tt:uu:vv:ww:xx, where each letter is a hex digit. See if you can help me with this.

thanks in advance.

Prakash2906, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mallesh on: 8/2/2012 [Member] Starter | Points: 25

Up
0
Down


Hi, try this following code line:

 \b 0[xX] ? [0-9A-Fa-f]{2} +\: \ 0[xX] ? [0-9A-Fa-f] {2} +\: \  0[xX] ? [0-9A-Fa-f] {2} +\: \  0[xX] ? [0-9A-Fa-f] {2} +\: \  0[xX] ? [0-9A-Fa-f] {2} +\: \  0[xX] ? [0-9A-Fa-f] {2}  \b 




== Mallesh

Prakash2906, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response