A regular expression and a Windows permission (cacls) question

In summary, the regular expression "\\+" matches the character \ literally and the quantifier + matches between one and unlimited times. There are several free online software applications available to try regular expressions with. The cacls command, used for modifying security descriptors, does not have the capability to grant "modify" access. This capability is available in its replacement, icacls, which was released in 2007.
  • #1
Crosshash
50
0
Hello, firstly, what does the regular expression "\\+" do? Would that literally match up "\+". Could I possibly get some recommendations on some software to try regular expressions with as well actually please?

and secondly, I've been fiddling around with the cacls command and I've noticed that it doesn't seem to be able to give users "modify" access. It can

give read, write, change and full control to users but not modify (and I think some others too). How do you grant modify access to a file in the command line?

(this is for my coursework and I'm kind of stumped on these two questions).

Thanks guys.
 
Computer science news on Phys.org
  • #2
Most likely, the question is about the regular expression without quotes. The regular expression \\+ matches the character \ literally. The + is the quantifier which matches between one and unlimited times.

In a different case - i.e. if we also include the quotes, the reg ex "\\+" matches the characters " and \ literally. For the character \ the expression uses the quantifier + which matches between one and unlimited times. It also matches the character " in the end.

Nowadays, with a simple google search, we can find a number of free online software applications for regular expressions of various flavors (PCRE, ECMAScript etc.) which help in learning about, testing, debugging, generate code etc.

The cacls command, which is an abbreviation for change access control lists, is a command line utility for displaying and modifying the security descriptors on folders and files. An access control list is a list of permissions for the object (file or folder) at hand. cacls has had a long history with the Windows operating system. Quoting from docs.microsoft.com : "The original cacls shipped with Windows NT 4.0 and enabled a set of basic capabilities for changing permissions at the command line but was limited in what it could accomplish. To resolve these limitations, Microsoft subsequently released an expanded xcacls in the Windows NT Resource Kit. Later yet, an unsupported xcacls.vbs was released that went further with capability but backward in terms of performance. ". Microsoft subsequently released - 2007 as initial release, icacls as cacls replacement, which is a full-featured version from Windows Server 2003 Service Pack 2 on and includes among others the modify capability, not present in the cacls command.
 

1. What is a regular expression?

A regular expression, or regex, is a sequence of characters that defines a search pattern. It is commonly used in programming and text processing to match and manipulate strings of text.

2. How does a regular expression work?

A regular expression works by using a combination of special characters, known as metacharacters, and literal characters to form a pattern. This pattern is then applied to a string of text to determine if there is a match.

3. What is the purpose of using regular expressions?

The purpose of using regular expressions is to search, replace, and manipulate text in a more efficient and precise way. It allows for complex string matching and pattern recognition, making tasks like data validation and text parsing much easier and more accurate.

4. What is cacls in Windows?

Cacls, or Change Access Control List, is a command line tool in Windows that allows users to view and modify permissions for files and directories. It is used to control access to resources and ensure the security and privacy of files.

5. How can regular expressions and cacls work together?

Regular expressions can be used in conjunction with cacls to match specific file or directory names and then apply appropriate permissions to them. This allows for more targeted and efficient permission management on Windows systems.

Similar threads

Replies
5
Views
2K
  • Computing and Technology
Replies
4
Views
1K
  • Computing and Technology
Replies
4
Views
1K
Replies
29
Views
4K
  • Computing and Technology
Replies
23
Views
2K
  • Computing and Technology
Replies
4
Views
3K
Replies
1
Views
2K
Replies
2
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
Replies
10
Views
2K
Back
Top