I have a need to extract a sub-string from a longer string. I know how I would approach it using PHP posstr(); and strpos();, but the data is very large and I suspect that it would be more efficient if I could extract the part string using regex.
For example, if I have a number, (say a latitude) that has the format
"3203.79453"
where the the two characters before and "all" the characters after the decimal point represent decimal seconds, then to obtain the decimal latitude I need to compute the following:
32 + (03.79453)/60 = 32.06324217
So in essence I need a regex method of extracting the sub-string "03.79453".
So two questions how do I achieve it using regex and is it faster than using the method of using strpos() and posstr().
Thanks