Skip to content

Instantly share code, notes, and snippets.

@ammarfaizi2
Created October 29, 2018 15:49
Show Gist options
  • Save ammarfaizi2/25a0d7b06c6a35e110f9bfe37e6dee1e to your computer and use it in GitHub Desktop.
Save ammarfaizi2/25a0d7b06c6a35e110f9bfe37e6dee1e to your computer and use it in GitHub Desktop.
<?php
$a =
"Hi there! My nickname is atb00ker. Today, 24-11-18 I learnt to use regular expressions!
Hi there! My nickname is Ajay. Today, 23-1-19 I learnt to use regular expressions!
Hello, i am Ajay
This is any other string.";
preg_match_all("/My nickname is [a-zA-Z0-9]*\. Today, \d{1,2}\-\d{1,2}\-\d{1,2} I learnt to use regular expressions!/Usi", $a, $m);
var_dump($m);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment