Hello,
I admit, I am not proficient with regex. I'm trying to match a pattern taken from the output of reformime. (see below). I am not having much luck. When I can get it to work, then it matches everything. I think this is due to the working pattern matching the longer pattern.
Sample input:
the output can be arbitrary in length. (from 1.2 down to however many attachments there are). My goal is to match a single digit followed by a period followed by the next to digits. I don't want to match anything beyond that.
I want to match any of the following:
1.1
1.2
1.6
...
1.29
examples of what I don't want to match:
1.2.1
...
1.29.1
1.29.1.1
(basically any of the 'sub' numbers)
Please let me know if this doesn't make sense.
I have tried various forms the following regex
\d\.\d{2}
.\...
and I found something like this on the internet
(?<!\d)\d{1}\.\d{2}(?!\d)
and tried to modify it to fit my needs, but didn't work.
Any help would be appreciated.
I admit, I am not proficient with regex. I'm trying to match a pattern taken from the output of reformime. (see below). I am not having much luck. When I can get it to work, then it matches everything. I think this is due to the working pattern matching the longer pattern.
Sample input:
Code:
1
1.1
1.1.1
1.1.1.1
1.1.1.2
1.1.2
1.2
1.2.1
1.2.1.1
1.2.1.2
1.3
1.3.1
1.3.1.1
1.3.1.2
1.4
1.4.1
1.5
1.5.1
1.5.1.1
1.5.1.2
1.6
1.6.1
1.6.1.1
1.6.1.2
1.7
1.7.1
1.7.1.1
1.7.1.2
....
1.29
1.29.1
1.29.1.1
1.29.1.2
....
the output can be arbitrary in length. (from 1.2 down to however many attachments there are). My goal is to match a single digit followed by a period followed by the next to digits. I don't want to match anything beyond that.
I want to match any of the following:
1.1
1.2
1.6
...
1.29
examples of what I don't want to match:
1.2.1
...
1.29.1
1.29.1.1
(basically any of the 'sub' numbers)
Please let me know if this doesn't make sense.
I have tried various forms the following regex
\d\.\d{2}
.\...
and I found something like this on the internet
(?<!\d)\d{1}\.\d{2}(?!\d)
and tried to modify it to fit my needs, but didn't work.
Any help would be appreciated.