Zenuke

I am trying to make a regular expression that will find things that start with a '/' and goto a '.' without hitting another '/'
I'm going through a list of web pages and I need to pretty much ignore anything thats '/folder/something' and find only
'/filename'

Is this possible


Re: Regular Expressions Regular expression help

Sergei Z

could u post some samples of the target text and show what should be done with it it always helps to see real text b4 suggesting anything.





Re: Regular Expressions Regular expression help

Zenuke

ok......
I need to find insances of /filename.ext and not things like /folder , /folder/filename.ext , /folder/foler/filename.ext etc etc
So exactly as I asked, I need to find things that start with a '/' and dont have any other /'s in them but they should include a .




Re: Regular Expressions Regular expression help

Sergei Z

ok...

i'm asking 2nd time: can u pls post some real target text which u'll be processing and which contains entries like

/folder/foler/filename.ext

or

/filename.ext

u may not realize this, but the regex syntax will depend on your data/text arrangement as well as on the way u r processing the data: EITHER as separate strings one-by-one OR as as filtering them out of chunk of text.





Re: Regular Expressions Regular expression help

Sergei Z

shooting in the dark, i can offer this regex

( <=\s|^|\A)/[^/]+\.\S+( =\s|$|\Z)

to match on entries like

/filename.ext

and not ot match on entries

/folder/filename.ext

when the entries are processed one-by-one as separate strings, and, questinably, when they are located in a piece of text delimited by >1 white spaces.