Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regular expressions make my brain ache...need help 1

Status
Not open for further replies.

iggystar

IS-IT--Management
Jul 12, 2001
126
US
Ack. I was never too experienced at reg exps, and taking 8 months off from them has only made me worse...

I have a program running that uses regular expressions and I'm having trouble figuring out what one does. I'd appreciate it if somebody could help me.

This is what it looks like:

/http\:\/\/[^\/]*[\x00-\x09\x0b\x0c\x0e-\x1f]/


Thanks.


ps The leading and trailing / above could be an anchor used by the program to identify where the regular expression starts and stops...then again maybe not. But if they look like they don't belong, discard them. The program probably uses them as anchors. Then again, if they look right, please include them.

As always, thanks in advance for any help.
 
It appears to be checking for control characters.

In perl, in a regex, the \x says the next two chars are hex values. So,
Code:
"\x00-\x09"  means hex(00) through hex(09)
\x0b         means hex(0b)
\x0c         hex(0c)
\x0e-\x1f    hex(0e) through hex(1f)
I think that ends up matching the control chars except line feed and carriage return. 'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top