I need a regular expression to detect the phrase Figure 1.5: in a given string. Also, I intend on using this expression in a PHP preg_replace() function.
Here are some more examples:
- ...are given.
Figure 2.1:shows that... - ...are given.
Figure 3:shows that... - ...are given.
Figure 1.16:shows that... - ...are given.
Figure 0.4shows that... - ...are given.
figure 5.1:shows that...
With my limited Regex knowledge, I was able to create this:
/\wFigure \d*\.?\d*/g
But that doesn't even begin to handle all of the permutations that could occur.
I would appreciate any suggestions that you might have.