I'm new to regular expressions, and was wondering how I could get only the first number in a string like 100 2011-10-20 14:28:55
. In this case, I'd want it to return 100
, but the number could also be shorter or longer.
I was thinking about something like [0-9]+
, but it takes every single number separately (100,2001,10,...)
Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…