metatonka
asked on
Need a regular expression to parse between / forward slashes
http://sccps-acorn/ddi/web/DLFT/TEST/one/21stwfd.jpg
1) url above
2) want to be able to identify the word "one". Everything before will be the same.
3) it is going to be the 6th word between the / forward slashes
4) would like to be able to configure which word between slashes ( ie 4th, 3rd etc)
5) i have a workflow that the 6th word will be the deciding factor when to run
6) want to ignore the file name
thank you
1) url above
2) want to be able to identify the word "one". Everything before will be the same.
3) it is going to be the 6th word between the / forward slashes
4) would like to be able to configure which word between slashes ( ie 4th, 3rd etc)
5) i have a workflow that the 6th word will be the deciding factor when to run
6) want to ignore the file name
thank you
ASKER
1) sorry for the confusion, that url is not available to the web. It is the example of url that i need the regular express to run on.
2) your suggestion provided the following result
/;/sccps;/ddi;/web;/DLFT;
3) what i am looking for is a regular express that gives me the word between two forward slashes in the sixth place after the http:// which in this example would be the word "one".
please let me know if you have any questions.
Thank you for helping.
2) your suggestion provided the following result
/;/sccps;/ddi;/web;/DLFT;
3) what i am looking for is a regular express that gives me the word between two forward slashes in the sixth place after the http:// which in this example would be the word "one".
please let me know if you have any questions.
Thank you for helping.
Try this pattern:
http://(?:[^/]*/){5}([^/]*)
ASKER
i tried extract with your suggestion, it came out blank
ASKER
my workflow regular expression has 4 options
replace text
check match
split
extract
replace text
check match
split
extract
the solution TerryAtOpus posted, returns to results, the one you need is the second one, so if your RegEX workflow return an array, get the second element of that array.
ASKER
AhmedGeek i assume you are saying to use http://(?:[^/]*/){5}([^/]*)
this is what happens
use this (?:[^/]*/){3}([^/]*) results are http://sccps-acorn/ddi/web/DLFT;
use this (?:[^/]*/){2}([^/]*) results are http://sccps-acorn/ddi/web;
use this (?:[^/]*/){4}([^/]*) results .....nothing
use this (?:[^/]*/){5}([^/]*) results .....nothing
not sure where to proceed.
thanks
this is what happens
use this (?:[^/]*/){3}([^/]*) results are http://sccps-acorn/ddi/web/DLFT;
use this (?:[^/]*/){2}([^/]*) results are http://sccps-acorn/ddi/web;
use this (?:[^/]*/){4}([^/]*) results .....nothing
use this (?:[^/]*/){5}([^/]*) results .....nothing
not sure where to proceed.
thanks
What language or editor are you using?
ASKER
nintex workflow 2007 software on sharepoint 2007
It appears that Nintex has .NET's regex library available. Modifying Terry's previous suggestion, try:
(?<=http://(?:[^/]*/){5})[^/]*
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
will ask nintex about their regular expression interpreter...will tell you the results.
ASKER
response from nintex
This regular expression would work : \w+(?=/[\w\d]+\.[\w\d]+)
We use the .Net Regular Expression engine. The following site is generally what my colleagues and I use when it comes to help build expressions: http://gskinner.com/RegExr/
and it does work.
will give you the credit.
This regular expression would work : \w+(?=/[\w\d]+\.[\w\d]+)
We use the .Net Regular Expression engine. The following site is generally what my colleagues and I use when it comes to help build expressions: http://gskinner.com/RegExr/
and it does work.
will give you the credit.
Open in new window
or try to upload the image on different site, so i can see what you really mean.