I need to write a regular expression for the following (NB. ignore carriage returns, I've added them for readability):
<strong>Contact details</strong>
<p><label>Office:</label> +44 (0)12 3456 7890<br />
<label>Direct:</label> +44 (0)12 3456 7890<br />
<label>Mobile:</label> +44 (0)1234 567890<br />
<label>E-mail:</label> <a href="mailto:[email protected]">[email protected]</a><br />
I am using
/([\+\d\(\)\s]+)/
Which matches the number blocks and I can use and offset of 0-2 to identify them. The problem is it is returning white space as well which is screwing up my offsets.
How do I say "it must contain at least one digit in the match"?
I did also try
/\<label\>Office:\<\/label\> ([\+\d\(\)\s]+)\<br \/\>/
But that would return
+44 (0)12 3456 7890<br />
<label>Direct:</label> +44 (0)12 3456 7890<br />
<label>Mobile:</label> +44 (0)1234 567890<br />
<label>E-mail:</label> <a href="mailto:[email protected]">[email protected]</a>