Home » , » Regex Examples

Regex Examples

Written By SBlog on Tuesday, February 5, 2019 | February 05, 2019

ExampleRegex
IP address(([2][5][0-5]\.)|([2][0-4][0-9]\.)|([0-1]?[0-9]?[0-9]\.)){3}(([2][5][0-5])|([2][0-4][0-9])|([0-1]?[0-9]?[0-9]))
Email[^@]+@[^@]+\.[^@]+
Date MM/DD/YY(\d+/\d+/\d+)

Date YY-MM-DD hh:mm:ss\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}

Integer (positive)(?
Integer[+-]?(?
Float(?<=>)\d+.\d+|\d+
Hexadecimal\s–([0-9a-fA-F]+)(?:–)?\s 
re.I merupakan kepanjangan dari re.IGNORECASE
sedangkan
re.M merupakan re.MULTILINE
Multi-line mode:
  ^ matches the start of each line
  $ matches the end of each line


0 comments:

Post a Comment

(^_^) [o_o] (^.^) (".") ($.$)