Package com._1c.g5.v8.dt.search.core
Class SearchUtils
- java.lang.Object
-
- com._1c.g5.v8.dt.search.core.SearchUtils
-
public final class SearchUtils extends Object
Utils to use global search
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String[]
getGroups(String text, String searchText)
Returns all string matching occurrences in the given text by thesearchText
regexp.static Collection<Pair<String,Integer>>
getGroupsWithOffsets(String text, String searchText, boolean caseSencetive)
Returns all string matching occurrences in the given text by thesearchText
regexp with their offsets.static Collection<org.eclipse.jface.text.IRegion>
searchTextRegions(String pattern, String text)
Search specific text pattern and return collection of region of matches in given text.
-
-
-
Method Detail
-
getGroups
public static String[] getGroups(String text, String searchText)
Returns all string matching occurrences in the given text by thesearchText
regexp.- Parameters:
text
- the text to search in, cannot benull
searchText
- the regexp expression or simple text to search, cannot benull
- Returns:
- an array with all found string occurrences, never
null
-
getGroupsWithOffsets
public static Collection<Pair<String,Integer>> getGroupsWithOffsets(String text, String searchText, boolean caseSencetive)
Returns all string matching occurrences in the given text by thesearchText
regexp with their offsets.- Parameters:
text
- the text to search in, cannot benull
searchText
- the regexp expression or simple text to search, cannot benull
- Returns:
- a collection with pairs: found string occurrences and its offset, never
null
-
searchTextRegions
public static Collection<org.eclipse.jface.text.IRegion> searchTextRegions(String pattern, String text)
Search specific text pattern and return collection of region of matches in given text.Note this search is case insensitive.
- Parameters:
pattern
- the text pattern to search, cannot benull
text
- the text to search in, cannot benull
- Returns:
- collection of regions with matches, never
null
-
-