USF-OS / FogOS

Other
1 stars 24 forks source link

strrev(), palindrome detection, and regex() #20

Closed ajcatoiu closed 4 months ago

ajcatoiu commented 4 months ago

Students: Andrew Phong

Will implement the following functions: strrev() - Takes a string and outputs it in reverse. Will likely be working in the kernel's string.c file. checkPal() - Will utilize strrev() to detect palindromes in strings. Palindromes will be displayed on their own line. Unsure how the user will run it (maybe with providing a command "checkPal" and then a string argument OR just executing the function in a user space test program and possibly read from a text file). regex() - Searches for a particular sequence of characters in a string. For example, we have a string of "qwertyuiop" and we want to search for the pattern of "tyu", then the function will return true, else return false.

malensek commented 4 months ago

The scope of this proposal is a bit too limited to be a full project. strrev is interesting but probably ~3 lines of code, although the user space utility definitely helps boost its usefulness.

There is already basic regex support (beyond even a string match) in user/grep.c