Skip to main content
Nintex Community Menu Bar

Extract Regular Expression

  • June 7, 2018
  • 7 replies
  • 66 views

Forum|alt.badge.img+4

Whats the expression that i can use to extract url without filename ?

https://xyz/sites/test/file.xlsb

7 replies

bamaeric
Nintex Partner
Forum|alt.badge.img+15
  • Nintex Partner
  • June 7, 2018

Try using this expression in the Pattern field:  /[^/]*$

The steps to configure the Regular Expression action are in my blog post: Remove a Forward Slash at the End of a URL String in Nintex Workflow


Forum|alt.badge.img+4
  • Author
  • June 7, 2018

Hi Eric, 

Thank you for reply. /[^/]*$ gets filename and removes url. I need url without filename.


bamaeric
Nintex Partner
Forum|alt.badge.img+15
  • Nintex Partner
  • June 7, 2018

Hi Rose,

Which version of Nintex Workflow are you using? I ran this in both Nintex Workflow 2013 and Nintex Workflow for O365, with both returning just the URL from your expression. If you're using the Nintex Workflow 2013, try using the Run Now option to see what you get. Below is how I configured the Regular Expression action.

Regular Expression - Remove file to get URL


Forum|alt.badge.img+4
  • Author
  • June 7, 2018

HI Eric, 

With Replace i got it. What would be the expression if i want to use extract option to store in collection variable ?


bamaeric
Nintex Partner
Forum|alt.badge.img+15
  • Nintex Partner
  • June 7, 2018

Try this pattern:  .*(?=/)


Forum|alt.badge.img+4
  • Author
  • June 8, 2018

Thank You Eric. By using this i got url without filename but with ; at end. 

https://xyz/sites/test/file.xlsb  - Result: https://xyz/sites/test;


Forum|alt.badge.img+4
  • Author
  • June 8, 2018

Thank You Eric. By using this i got url without filename but with ; at end. 

https://xyz/sites/test/file.xlsb  - Result: https://xyz/sites/test;

I have used  .*(?=/)/ and it worked. Thank You once again.