/src/lib/regular_expression/internal/regular_expression_items/regular_expression_item_text_no_case.e
Specman e | 60 lines | 26 code | 7 blank | 27 comment | 0 complexity | 6d6ae2c869e33ffd8b84573467286ca2 MD5 | raw file
1-- This file is part of a Liberty Eiffel library. 2-- See the full copyright at the end. 3-- 4class REGULAR_EXPRESSION_ITEM_TEXT_NO_CASE 5 -- 6 -- accept one string 7 -- 8 9inherit 10 REGULAR_EXPRESSION_ITEM 11 12create {ANY} 13 make 14 15feature {ANY} 16 text: STRING 17 -- the accepted string 18 19 make (value: STRING) 20 require 21 value_not_void: value /= Void 22 value_not_empty: value.count > 0 23 do 24 text := value.as_upper 25 ensure 26 definition: text.is_equal(value.as_upper) 27 text_not_void: text /= Void 28 text_not_empty: text.count > 0 29 end 30 31 explore (matcher: BACKTRACKING_REGULAR_EXPRESSION) 32 do 33 matcher.match_string_no_case(text) 34 end 35 36invariant 37 text_not_void: text /= Void 38 text_not_empty: text.count > 0 39 40end -- class REGULAR_EXPRESSION_ITEM_TEXT_NO_CASE 41-- 42-- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file. 43-- 44-- Permission is hereby granted, free of charge, to any person obtaining a copy 45-- of this software and associated documentation files (the "Software"), to deal 46-- in the Software without restriction, including without limitation the rights 47-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 48-- copies of the Software, and to permit persons to whom the Software is 49-- furnished to do so, subject to the following conditions: 50-- 51-- The above copyright notice and this permission notice shall be included in 52-- all copies or substantial portions of the Software. 53-- 54-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 55-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 56-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 57-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 58-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 59-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 60-- THE SOFTWARE.