/src/lib/regular_expression/internal/regular_expression_items/regular_expression_item_text_no_case.e

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