Making regular expressions bold

I have some coordinates on my site that are printed as:

z:000

I would like to have this (including the z) printed in bold. The coordinates are in a text string like so:

$string = 'Lorem ipsum z:000 dolor sit amet';

I think I have to do this with Regex, but I'm not getting it to work. The first part is fixed, so the parts of the regex are ^z: and [0-9]

Answers


This should help

preg_replace("/(z:[0-9]{3})/", '<b>${1}</b>', $string);

Works for z:000 to z:999


Need Your Help

How to find a functions address to hook/detour in an EXE file?

c++ c windows hook

I drove against a wall again and need your help with some low-level stuff. I already succeeded in hooking exported DLL-Functions (with this code btw.) by injecting them into my target process (e.g....

how to change all table prefix in a single query

mysql table phpmyadmin prefix

I am pretty amateur in mysql..can you please tell me how can I change table prefixes of my whole database in a single query... I can do it manually, but its quite time consuming to change all the t...

PHP variable value from string

php string variables eval

How can I get value from variable which is string ?