Reputation: 509
I have a problem implementing a regex for a particular scenario.
Lets say the input is "the brown dog" to be searched from "the quick brown fox jumps over the lazy dog". It should return true with the following conditions:
This means inputs like "the dog brown", "fox brown", "the quick fox brown" would return false but "the dog", "quick brown", "jumps over the" return true. I hope i provided enough samples.
So far my regex "(?i)(?:\\S+\\s)?\\S*"+targetString+"\\S*(?:\\s\\S+)?"
only works for exact strings but not in between other words.
Upvotes: 2
Views: 94