Sha256: 298d5d8cf39948e2126c4cb66f71c4a6fdedc787130013a29733a692c7bc5a65

Contents?: true

Size: 411 Bytes

Versions: 26

Compression:

Stored size: 411 Bytes

Contents

#	This file is part of the "Utopia Framework" project, and is licensed under the GNU AGPLv3.
#	Copyright 2010 Samuel Williams. All rights reserved.
#	See <utopia.rb> for licensing details.

class Regexp
	def self.starts_with(string)
		return /^#{Regexp.escape(string)}/
	end

	def self.ends_with(string)
		return /#{Regexp.escape(string)}$/
	end

	def self.contains(string)
		return Regexp.new(string)
	end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
utopia-0.9.58 lib/utopia/extensions/regexp.rb
utopia-0.9.57 lib/utopia/extensions/regexp.rb
utopia-0.9.56 lib/utopia/extensions/regexp.rb
utopia-0.9.55 lib/utopia/extensions/regexp.rb
utopia-0.9.54 lib/utopia/extensions/regexp.rb
utopia-0.9.53 lib/utopia/extensions/regexp.rb
utopia-0.9.52 lib/utopia/extensions/regexp.rb
utopia-0.9.51 lib/utopia/extensions/regexp.rb
utopia-0.9.50 lib/utopia/extensions/regexp.rb
utopia-0.9.49 lib/utopia/extensions/regexp.rb
utopia-0.9.48 lib/utopia/extensions/regexp.rb
utopia-0.9.47 lib/utopia/extensions/regexp.rb
utopia-0.9.46 lib/utopia/extensions/regexp.rb
utopia-0.9.45 lib/utopia/extensions/regexp.rb
utopia-0.9.43 lib/utopia/extensions/regexp.rb
utopia-0.9.42 lib/utopia/extensions/regexp.rb
utopia-0.9.41 lib/utopia/extensions/regexp.rb
utopia-0.9.40 lib/utopia/extensions/regexp.rb
utopia-0.9.39 lib/utopia/extensions/regexp.rb
utopia-0.9.38 lib/utopia/extensions/regexp.rb