简体   繁体   中英

REgex not working for white space javascript

I am trying to validate string which can take only alphanumeric values without space.

str.replace(/[^a-zA-Z0-9\u00E0-\u00FC ]+/gi, '')

I used above code but seems still it is taking white space. Did not able to find the right way to fix it.

Remove the space in regexp

  str.replace(/[^a-zA-Z0-9\u00E0-\u00FC]+/gi, '')
  //  ---------------------------------^ here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM