Jump to content

Recommended Posts

/[^0-9a-z]/i

@neil - your A-z will allow all characters between Z and a in the ASCII table too

 

I think there are no characters between cap A and cap Z on the ASCII table? And I need it to be able to recognize both lowercase and uppercase if that makes a difference.

My regex does...and yes there are

http://www.asciitable.com/

 

There are between cap Z and low a but not between cap A and cap Z. So I'm seeing this on some sites... would this do what I want it to?

 

/[^0-9A-Za-z]/

 

I want to use ur example Jay but I would think that it is case sensitive and being a ISBN there will mostly be capitals unless the person is too lazy to put caps

oops. Thats what I meant. Yes it will although I don't see what was wrong with my regex? it was case insensitive (hence the i after the /) so it does the same thing

 

Sorry I didn't know what the /i meant. I don't know much about reg expressions at all. So would this be what i would do to remove all of the non a-z's and 0-9's

 

preg_replace("/[^0-9a-z]/i", "", $bookISBN)

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.