python - regex to strict check numbers in string -


example strings:

  1. i numeric string 75698
  2. i alphanumeric string a14-b32-c7d

so far regex works: (\s+)$

i want add way (probably ahead) check if result generated above regex contains digit (0-9) 1 or more times?

this not working: (\s+(?=\s*\d\s*))$

how should it?

look ahead not necessary this, :

(\s*\d+\s*) 

here test case :

http://regexr.com?34s7v


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -