Reg. Exp. or string methods

  • Thread starter Thread starter neverstill
  • Start date Start date
N

neverstill

Hi-

I need to parse some strings and I was thinking that I might use Regular
Expressions. I was curious though(I have never used them), are they
processor intensive to use?

Let's say that I had a string(url)
http://www.SomeDomain.com/Products?id=rt2355
and I wanted to parse out the word "Products"

Now I know I could get the index of the last '/' and the first '?' and then
get a substring from that, but I'm thinking there would be a pretty easy
Regular Expression to do that as well. Question is, when do you decide
which is better?

What do you all think?

Thanks,
Steve
 
whoa.... not the easiest syntax in the world, is it?

I thought that what I wanted would not be too hard, but after reading that
there are different engines, versions, etc...

if I wanted to get "Products" out of
http://www.SomeDomain.com/Products?id=333 how would I do that? What would
the expression be?
If I can see just one sample of this, then I would be able to run with that
and extend it for my other needs... but right now I can't figure out how to
get the last character in a string, in this case I would like to get a range
of cahracters between the last '/' and the first '?'

hhhmmm.....
 
Back
Top