RegEx to Find integers in a string

This simple RegEx will match integers in a string, whether they're at the beginning of the string, in the middle, or at the end of a sentence.
/(?:^|\s+)([0-9]+)(?:\s+|\.|\?|\!)/
Posted by
Snippet Viewed 1466 times.

Share your RegEx code snippets:

  • Get some recognition & link back to your site.

 

Submit | Browse

Most Recent regex snippets

Most Viewed