<?php

$path = 'file:\/\/\/specs\/operators.json#\/definitions\/number';
$path = preg_quote($path); 


$jsonString = '{"type":"object","properties":{"id":{"$ref":"file:\/\/\/specs\/operators.json#\/definitions\/number","description":"описание"}';
preg_match('~("\$ref":"'.$path.'")~', $jsonString, $match);

var_export($match);
