shahrukh1 Posted December 2, 2012 Share Posted December 2, 2012 trying to obtain: href="/echess/game?id=61279056" I do not know the length of the digits, but it is closed with a quotation. I do not know the starting digit. I do know, it will only be a number of unknown length expression attempted with: $expression = "#href=\"/echess/game?id=[0-9]*\"#i"; results: Failed Link to comment https://forums.phpfreaks.com/topic/271507-regex-with-numbers/ Share on other sites More sharing options...
Christian F. Posted December 3, 2012 Share Posted December 3, 2012 You need to escape the question mark, otherwise it'll be considered a meta-character that makes the "e" in "game" optional. Link to comment https://forums.phpfreaks.com/topic/271507-regex-with-numbers/#findComment-1397073 Share on other sites More sharing options...
shahrukh1 Posted December 3, 2012 Author Share Posted December 3, 2012 thankyou, fixed with "#id=[0-9]*\"#i" Link to comment https://forums.phpfreaks.com/topic/271507-regex-with-numbers/#findComment-1397138 Share on other sites More sharing options...
Christian F. Posted December 3, 2012 Share Posted December 3, 2012 You're welcome, glad I could help. Link to comment https://forums.phpfreaks.com/topic/271507-regex-with-numbers/#findComment-1397146 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.