Lines 1026-1033
sub clean_search_term {
Link Here
|
1026 |
# screen all brackets with backslash |
1026 |
# screen all brackets with backslash |
1027 |
$term =~ s/(?<!\\)(?:[\\]{2})*([\{\}\[\]])$lookahead/\\$1/g; |
1027 |
$term =~ s/(?<!\\)(?:[\\]{2})*([\{\}\[\]])$lookahead/\\$1/g; |
1028 |
|
1028 |
|
1029 |
# remove problematic punctuation and escaped slashes surrounded by spaces if truncate |
1029 |
# Remove problematic punctuation and escaped slashes surrounded by spaces if truncate. |
1030 |
$term =~ s/\s+(\s*[&;,:\.=\-\/]|(\\\/)\s*)+\s$lookahead/ /g if $truncate; |
1030 |
# This mainly relates to ISBD punctuation. |
|
|
1031 |
# Note that slashes identified as RE limits will not be removed nor the contents of RE |
1032 |
# will be altered (cf. @saved_regexes). In other cases (i.e. escaped slashes |
1033 |
# (cf. QueryRegexEscapeOptions) and unescaped slashes not identified as being limits |
1034 |
# to a RE, i.e. the last odd unescaped slash), the slashes will be removed. |
1035 |
$term =~ s/\s([&;,:\.=\-\/\s]|(\\\/))+\s$lookahead/ /g if $truncate; |
1031 |
|
1036 |
|
1032 |
# restore all regex contents after escaping brackets: |
1037 |
# restore all regex contents after escaping brackets: |
1033 |
for (my $i = 0; $i < @saved_regexes; $i++) { |
1038 |
for (my $i = 0; $i < @saved_regexes; $i++) { |
1034 |
- |
|
|