Hi
I'm trying to construct a regex to match some product codes in a particular format. The format is as follows: A 4 digit year between 1985 and 2038, followed by any number > 0, which may be optionally padded with zeros to exactly 6 digits. The sequences may appear anywhere in a longer string of any type of unicode characters.
So the following would be valid:
20031234
2003001234
2000000001
20001
20030001234 - should match on 2003000123
0020031234 - should match on 20031234
These would not be valid:
1984001234
2039001234
200301234
An example of the input string would be something like this:
Lorem ipsum dolor sit amet, consectetuer adipiscing el20031234it. Donec
consequat. Aenean dolor diam, imperdiet at, facilisis at, fringilla ut,
justo. Morbi sem. Quisque nec sem aliquam nisl euismod ultrices.
Vestibulum in eros eget massa rhoncus pellentesque. Ut cursus tellus
vitae sapien. Mauris 2003001234 a lorem. Aenean est. Nunc vehicula, nisl ac auctor
mollis, lacus lectus condimentum turpis, eu sagittis massa orci id 1924000012350nibh. In molestie ultricies turpis. Donec suscipit, justo eget sodales
convallis, magna purus euismod massa, in sodales magna lacus quis
sapien. 200003001234Aliquam eleifend, risus sed varius elementum, leo nulla feugiat
mi, ut pharetra lorem mauris eget lacus.
From which I need to match 20031234 and 2003001234
Can this actually be done or is my spec too vague?
Thank you very much!!!!