I am pretty new to Patterns and some help would be great.
I am building a webcrawler, which looks for a specific pattern in the path.
Right now I am using Pattern.quote to produce a literal string.
Let’s say Pattern.quote produces \Q/test/live/167909\E in which after the second slash (thus live) is always the same. Because test and 167909 is random I created this pattern \Q/*/live/*\E , but I can’t use this to create a new Pattern.
Any help is welcome.
The expression
".*/live/.*"matches paths with the pattern you describe. You can create a Pattern with that.Alternatively, as Peter said, you could simply ask
path.contains("/live/");