Jump to content

Characters


cags

Recommended Posts

This isn't exactly a Regular Expressions question, but since it's in relation to a pattern and I couldn't think of anywhere better to put it, it's going in the Regular Expressions section. The PHP manual defines valid user-defined function names as being...

 

[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*

 

Ok, fair enough, but what characters are \x7f-\xff? As far as my knowledge stretches \x is an escape character followed by a hex code of some kind. But they aren't any valid ASCII characters that I know of, so what encoding is it? I never did fully understand character encodings.

Link to comment
Share on other sites

If that is the case, that doesn't make a whole deal of sense (to me at least). Since \x7f-\xff indicates all characters in that range, 7f is DELETE, &nbsp is also included in that range. I can perhaps understand some of the foreign characters being accepted but there are a lot of characters in that range that I really wouldn't expect to be valid. Having said that, I tested a few at random such as ¶ and they do appear to be valid.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.