tag:blogger.com,1999:blog-5856229816967035312.post8181669512944077996..comments2023-07-02T05:44:26.415-07:00Comments on mySQL Hints: Tips, Suggestions, and Findings: How to Find Out if an Entire String Is NumericMySQL DBA Guyhttp://www.blogger.com/profile/09642019350937418521noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-5856229816967035312.post-39066533261977347852015-02-10T01:07:42.795-08:002015-02-10T01:07:42.795-08:00Thanks =)Thanks =)Anonymoushttps://www.blogger.com/profile/01028799366505699452noreply@blogger.comtag:blogger.com,1999:blog-5856229816967035312.post-76061356867376752442015-02-09T15:37:23.684-08:002015-02-09T15:37:23.684-08:00SELECT str FROM tbl WHERE LEFT(str,2) REGEXP '...SELECT str FROM tbl WHERE LEFT(str,2) REGEXP '[0-9]+';MySQL DBA Guyhttps://www.blogger.com/profile/09642019350937418521noreply@blogger.comtag:blogger.com,1999:blog-5856229816967035312.post-86543031030369300722015-02-04T04:30:20.871-08:002015-02-04T04:30:20.871-08:00Couldn't find any resources on how to test if ...Couldn't find any resources on how to test if part of a string is numeric - how would you test if the first two characters of a string were numeric?Anonymoushttps://www.blogger.com/profile/01028799366505699452noreply@blogger.comtag:blogger.com,1999:blog-5856229816967035312.post-35228445171242329162012-01-25T11:19:07.476-08:002012-01-25T11:19:07.476-08:00Whoops, that should be:
REGEXP('^([+-]?[0-9]+...Whoops, that should be:<br /><br />REGEXP('^([+-]?[0-9]+\.?[0-9]*e?[0-9]+)|(0x[0-9A-F]+)$')<br /><br />That way it only matches a full hex valueRob Smithhttps://www.blogger.com/profile/14213708178443139889noreply@blogger.comtag:blogger.com,1999:blog-5856229816967035312.post-3670582831675734502012-01-24T22:04:01.206-08:002012-01-24T22:04:01.206-08:00The full regex for php's is_numeric is:
REGEXP...The full regex for php's is_numeric is:<br />REGEXP('(^[+-]?[0-9]+\.?[0-9]*e?[0-9]+$)|(0x[0-9A-F]+)')<br /><br />As it supports more then just intsRob Smithhttps://www.blogger.com/profile/14213708178443139889noreply@blogger.com