Questions tagged [slash]

Please do not use this tag. The / character ("forward slash", or just "slash") is a directory separator in URLs and in many operating systems including Linux (Windows uses \ (backslash) but many applications and APIs also accept /). It is also the division operator in many languages, and marks closing tags in XML/HTML. In some languages, / characters delimit regular expressions.

The slash character / (sometimes called forward slash to distinguish it from \ ) has several common meanings in computing:

  • / is the directory separator in file names on Unix-like and POSIX operating systems, including Linux. Many Windows APIs and applications accept / as a directory (folder) separator, although some require a backslash \ instead. / is also the directory separator in URLs.
  • In many programming languages, / is the division operator . When applied to integers, / returns the quotient of the division in many languages.
  • In SGML based languages including and , / marks closing tags, as in <b>bold</b> or <br />.
  • / is a common delimiter for regular expressions searches (in , , , etc.).
465 questions
7
votes
2 answers

Escaping backslash in Postgresql

I'm trying to write an sql function in Postgresql that will parse a file path. I want to return just the file name. I cannot get past getting an accurate text string in the function. Here is the function: Function: job_page("inputText"…
mohnston
  • 737
  • 1
  • 6
  • 18
7
votes
4 answers

T-SQL - How to escape a slash / in square brackets in LIKE clause

I'm trying to use T-SQL LIKE against multiple values. After my research, the easiest way seems to be something similar to: SELECT Column1 FROM Table_1 WHERE Column1 LIKE '[A,B,C]%' So that I can expect the output looks like A1,B2,C3... My problem…
Ben S
  • 159
  • 3
  • 3
  • 10
6
votes
1 answer

Is there an alternative for the slash in a path?

I have an application which correctly escapes slashes ("/) in file names to avoid path traversal attacks. The secret file has this path: /tmp/secret.txt I want to access this file by uploading a file with a special crafted file name (something like…
Yeti
  • 1,108
  • 19
  • 28
6
votes
1 answer

backward slash followed by a number in python strings

I've encountered a problem in Python when dealing with backward slashes followed by numbers inside a string. I use windows OS environment. This becomes especially annoying when you have numbers in the beginning of a name in a directory. Ex:…
AlexG
  • 63
  • 1
  • 6
5
votes
3 answers

Regex / Remove slash from string in ruby

Thanks in advance... I am having some trouble with regular expressions in ruby, or otherwise finding a way to remove a slash from a string. Here is how my string looks: string = "word \/ word" I am trying to remove both the backslash and the…
Jacob Terry
  • 209
  • 1
  • 3
  • 6
5
votes
2 answers

Avoid the slash(/) between Spring RequestMapping

Consider the following example: @Controller @RequestMapping({"/home"}) public class Home { @RequestMapping(value = { "", "/" }) public String index() { return "home"; } @RequestMapping(value = { "-of-{id}" }) public…
knly
  • 81
  • 1
  • 4
5
votes
1 answer

Rewrite module to handle site version folders (strip slash)

I'm using the following rule to use folders for different versions: RewriteEngine On RewriteRule .* - [E=VERSION:020] RewriteRule ^versions/(.*)$ versions/$1 [L] RewriteRule ^(.*)$ versions/%{ENV:VERSION}/$1 [L] I have a structure…
Soundstep
  • 618
  • 2
  • 6
  • 11
5
votes
1 answer

Setting path in Gradle. When to use slash '/' and when colon ':'

I'm learning Gradle (version 4.10 now) and i am confused with setting path using separators ':' and '/'. In which situations it's propper to use this types? I'm not sure but it looks like colons can be used only when setting dependencies, including…
Piotr Bartoch
  • 407
  • 1
  • 5
  • 18
5
votes
1 answer

CrawlSpider with Splash

I have some problem with my spider. I use splash with scrapy to get link to "Next page" which is generate by JavaScript. After downloading the information from the first page, I want to download information from the following pages, but…
5
votes
5 answers

remove multiple trailing slashes mod_rewrite

I know this question was asked a number of times on this site alone, but browsing through the relevant posts I couldn't find a solution. Trying to remove multiple trailing slashes after domain. The following mod_rewrite expressions seem to work for…
Boyan
  • 165
  • 1
  • 2
  • 8
5
votes
5 answers

Explain Backslash in C

Can anyone please explain the below code and please also explain the role of backslash( \ ) in such situations. And what \' , \" , \ooo , \ \ , \? means? #include int main(){ char a = '\010'; char y = '010'; …
Tonmoy
  • 557
  • 2
  • 6
  • 20
5
votes
2 answers

Removing The Trailing Slash from a directory in htaccess

The following is my directory structure Root/ index.php contact.php projects.php /index.php /project1.php /project2.php I have rewrites in place to remove the .php extension from all file…
ghosh
  • 163
  • 5
  • 16
5
votes
1 answer

Changing "/" into "\" in R

I need to change "/" into "\" in my R code. I have something like this: tmp <- paste(getwd(),"tmp.xls",sep="/") so my tmp is c:/Study/tmp.xls and I want it to be: c:\Study\tmp.xls Is it possible to change it in R?
Ania
  • 67
  • 1
  • 1
  • 3
4
votes
2 answers

MVC 3 - Slashes and spaces in route

I have the following route defined in my Global.asax (MVC 3 web project): routes.MapRoute( "BlogCategory", // Route name "Blog/Category/{*category}", // URL with parameters new { controller = "Blog",…
4
votes
8 answers

How to remove slash from string in C#

I have a string like this: "/AuditReport" It is assigned to variable rep. If I type var r = rep.SysName.Remove(1, 1); It returns "/uditReport" instead of desired "AuditReport", i.e. it does not remove the slash. How could I remove it?
Liker777
  • 2,156
  • 4
  • 18
  • 25
1 2
3
30 31