Home:ALL Converter>Regular expression that contains some logic

Regular expression that contains some logic

Ask Time:2017-10-08T00:27:48         Author:Asif Iqbal

Json Formatter

I am looking a regular expression that contains two logic: 1. Does not contain any white space 2. Must contain (/ or . or both) . Number of (/ or .) may be one or multiple.

$text = "Hi jaghdja ahja.ja//hda manmna.bnm bana na/bbnavn.com"; //for an example
//expecting output an array("ahja.ja//hda","manmna.bnm","na/bbnavn.com");

What I am using

preg_match_all("#([^\s]|\.|\/)*#",$a,$arr);
print_r($arr);

Author:Asif Iqbal,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/46622498/regular-expression-that-contains-some-logic
yy