summaryrefslogtreecommitdiff
path: root/lib/rexml/functions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rexml/functions.rb')
-rw-r--r--lib/rexml/functions.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/rexml/functions.rb b/lib/rexml/functions.rb
index 0db9b98a53..010926611e 100644
--- a/lib/rexml/functions.rb
+++ b/lib/rexml/functions.rb
@@ -157,12 +157,9 @@ module REXML
# Kouhei fixed this too
def Functions::substring_after( string, test )
ruby_string = string(string)
- ruby_index = ruby_string.index(string(test))
- if ruby_index.nil?
- ""
- else
- ruby_string[ ruby_index+1..-1 ]
- end
+ test_string = string(test)
+ return $1 if ruby_string =~ /#{test}(.*)/
+ ""
end
# Take equal portions of Mike Stok and Sean Russell; mix