Regex

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file lib/regex. To experiment with that code, run bin/console for an interactive prompt.

TODO: Filter data and check format data.

Installation

Add this line to your application's Gemfile:

gem 'regex_data'

And then execute:

$ bundle

Or install it yourself as:

$ gem install regex_data

Usage

Methods:

  • Check email: email?
  • Check password: strong_password?
  • Check birthday: birth_day?
  • Banned words should not be used: ban_word
  • Check ip address: ip_address_v4?
  • Check format date (dd-mm-yyyy / dd-mm-yy / dd.mm.yyyy / dd.mm.yy): date?
  • Check URL: url?
  • Remove all empty line: remove_empty_line ``` str =" aaa aaa aa a a a " puts Regex::remove_extra_space(str) #=> aaa aaa aa a a a

email = "[email protected]" puts Regex::email?(email)

=> true

html = "Lorem Ipsum is simply dummy text of the printing and typesetting industry." puts Regex::remove_html_tag(html)

=> Lorem Ipsum is simply dummy text of the printing and typesetting industry.

date = "21.12.1995" puts Regex::date?(date)

=> true

str = "Lorem Ipsum is simply dummy text of the printing and typesetting industry" puts Regex::ban_word( str, "is", "text", "and")

=> Lorem Ipsum **** simply dummy **** of the printing **** typesetting industry


## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).