Reputation: 2059
I want to filter a number out of a string with php preg_match that could look like this (they are versions of a software):
(1.6.2#2 is 2. beta of 1.6.2)
So when there is a string like:
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, 1.6.2# sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Now I want a string that only contains "1.6.2#2"
I tried
(\d?[.|#]?)*
but it does not work
Upvotes: 1
Views: 81