Regular Expressions - Match all alphanumeric characters except individual numbers

Posted by imaginonic on Stack Overflow See other posts from Stack Overflow or by imaginonic
Published on 2013-10-29T15:51:32Z Indexed on 2013/10/29 15:53 UTC
Read the original article Hit count: 167

Filed under:
|
|

I would like to create a RegEx to match only english alphanumeric characters but ignore (or discard) isolated numbers in Ruby (and if possible in JS too).

Examples:

1) I would like the following to be matched:

  • 4chan
  • 9gag
  • test91323432
  • asf5asdfaf35edfdfad
  • afafaffe

But not:

  • 92342424
  • 343424
  • 34432 and so on..

The above is exactly what I would want.

2) However, I would be really thankful if someone could also include French letters like:

  • é
  • ë
  • ê (These are just few examples of many)

1) is my priority, it's totally okay if 2) is impossible or difficult to implement.

Sorry, my regex skills aren't that great (hence this question!)

Thank you.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about ruby