HOWTO: match the last occurrence when version numbers are listed in ascending order (newest last)

1 view
Skip to first unread message

Scott Miller

unread,
Dec 9, 2007, 12:25:49 PM12/9/07
to app2date
If the page you are trying to parse lists the version numbers in
ascending order (oldest first) you can use a lookahead assertion to
match the last (newest) occurrence. For example:

([\d\.]{3,})(?!.*[\d\.]{3,})

matches the last occurence of three or more digit/dot characters.
Reply all
Reply to author
Forward
0 new messages