Reputation: 9018
Do you know what the regex expression would be to find the last text after a period.
exampels
this.is.a.test = test
GOOG.N.QQ.HH = HH
Any ideas?
Thank you.
Upvotes: 3
Views: 17498
Reputation: 22457
Short and simple: a list of characters at the end of a line, not containing the full stop:
[^.]+$
Since GREP is greedy by default, it will match as much as possible characters, so for these two test strings it will return everything after the last full stop until the end-of-string.
Upvotes: 11
Reputation: 425003
This will match text following the last dot, or the whole string if there are no dots:
(?<=\.|^)[^.]+$
The whole match is your target, because a (non-capturing) look behind is used to assert the match is preceded by a dot or start-of-input.
See demo
Upvotes: 1
Reputation: 165
Maybe you should go with something like:
\.([^\.]+)$
Hope it helps!
Upvotes: 0