Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Simple regex help

I need a regex match so that it will get only digits that are in a group or 1-5 and are not surrounded by .'s or does not start with a dot.
For example "id=test>23.34<\id>" would not be picked up because both are surrounded by .'s but "id=test>2354<\id>" would because it is alone.I am trying to learn regex so an explanation would help. Thanks.
How many digits is the ID? Is it the same amount of digits each time or does it change?? Does it contain letters or anything other than numbers?
(Jun 1, 2015 10:44 PM)frawg Wrote:  How many digits is the ID? Is it the same amount of digits each time or does it change?? Does it contain letters or anything other than numbers?

The id is 1 - 5 digits around and it does change from time to time.There is also no letters. But these 1-5 digits cannot contain a . to the left or right of them.
I'm also learning regex. This code that you will see below could most likely be improved, but it works.

PHP Code

<?php 
id
=test>([^.][0-9]{0,}) 

That regex code will not include .'s and include numbers 0 to 9, for whatever length.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by TheWarOwlAug 23, 2017 10:13 PM 2 121 Aug 23, 2017 10:13 PM
Last Post: TheWarOwl
[.NET] by WhatIsRSOct 31, 2016 07:51 PM 7 245 Oct 31, 2016 07:51 PM
Last Post: Ninja
[.NET] by Mad HatterFeb 18, 2015 07:41 AM 5 132 Feb 18, 2015 07:41 AM
Last Post: Only3