0

Using Acunetix and it apparently supports regex.

Since I'm trying to have it exclude specific directories containing a string, I don't know why I'm having such a hard time trying to find this.

Given that I'm not working in python or coding anything, I'm not sure if the the pages I've run across don't apply or not.

How can I use regex to simply match anything containing a string such as "/form/" in the URL? What regex expression matches anything including that? Not even sure if I'm asking this right.

Would it simply be (/form/)?

1 Answer 1

1

For this for example:

http://www.mail.com/form/"ergqerg"/somethingelse

use this:

 /\S+\.\w{2,3}\/form\/(.*?)\//

then use $1 to access the matched string ("ergqerg")

so if your editor supports replace.. you can do:

Find and replace:

Find: /\S+.\w{2,3}/form/(.*?)//

Replace: $1

you will replace the found strings with what is between slashes (/) after "form'.

If you want to match strings that contain "form" you can do this:

/^.+(form)\S+/

It matches whole strings that have word "form" in them. if you do just /form/ you will match only word "form" not the full strings that contain them

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks. There's only a box to plug in a regex expression to exclude URLs containing whatever the regex expression finds. Is your solution any better than the simple regex one I listed? Sorry I'm not that familiar with Regex other than a few things in python.
Oh, I thought you want to match everything after the "form".. If you just want to match the /form/ than your solution is good. I will update the answer
To match lines with url that contain /form/, try the following. ^.*/form/.*$
Thanks. Is there any difference between hwnd's solution and just regular (/form/)?
hwnd's solution selects the whole line. /form/ selects only word "form", This : /^.+(form)\S+/ selects individual strings (i.e. does not select full line)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.