davidshields
Programmer
Hokay -
strpos tells me where needle is in haystack. Lovely.
ereg tells me that regexp is in haystack (and returns it to me). Lovely.
Except...
needle is a string. How do I find the offset into a string of a bloody regexp ???
Am I being really thick, or is this hard ? I want to find something more complicated than a string, so I choose regexp, and I want to know *where* it is.
Surely I'm not the forst person to need this - after all all regexp handling editors (yes, Textpad we love you) do this.
Please put me out of my misery.
WaveyDavey.
strpos tells me where needle is in haystack. Lovely.
ereg tells me that regexp is in haystack (and returns it to me). Lovely.
Except...
needle is a string. How do I find the offset into a string of a bloody regexp ???
Am I being really thick, or is this hard ? I want to find something more complicated than a string, so I choose regexp, and I want to know *where* it is.
Surely I'm not the forst person to need this - after all all regexp handling editors (yes, Textpad we love you) do this.
Please put me out of my misery.
WaveyDavey.