Reputation: 23517
I'm trying to check if a string looks like my.company.foo.A
or your.whatever.bar.B
.
The point is, I want to match or strings that have .bar.
or .foo.
And I have this regex
(.*\\.foo\\..* | .*\\.bar\\..*)
but which didn't seem to work.
Can someone help me out here?
Upvotes: 0
Views: 42
Reputation: 23381
The problem is the space on your regex:
(.*\\.foo\\..* | .*\\.bar\\..*)
| |
Take it out and you should be fine
(.*\\.foo\\..*|.*\\.bar\\..*)
Upvotes: 1