MJ
asked on
JS Regex for first level directory with/without Query String?
What would the JS regex be for a directory "/m/" ("m" is the actual directory name) with or without a query string? No file name will ever show, only a possibility of query strings. Regex has to fail if another directory is present. This is the first level dir on a website which is the value returned by location.pathname. Examples:
Yes - /m/
Yes- /m/?a=b
No - /m/n/
No - /m/n/?a=b
Yes - /m/
Yes- /m/?a=b
No - /m/n/
No - /m/n/?a=b
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER