Skip to content

elouiestudent/RegularExpressions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

RegularExpressions

Problem numbers correspond with dictionary index

  1. Determine whether a string is either 0, 100, or 101.
  2. Determine whether a given string is a binary string (ie. composed only of 0 and 1 characters).
  3. An integer (sub)string refers to a non-empty (sub)string that will convert to an integer but has no leading 0. Zero is represented as the single digit 0. Given a binary integer string, what regular expression determines whether it is even?
  4. What is a regular expression to determine (ie. match) those words in a text that have at least two vowels?
  5. Given a string, determine whether it is an even binary integer string.
  6. Determine whether a given string is a binary string containing 110 as a substring.
  7. Match on all strings of length at least two, but at most four.
  8. Validate a social security number entered into a field (ie. recognize ddd-dd-dddd where the d represents digits and where the dash indicates an arbitrary number of spaces with at most one dash). For example, 542786363, 542 786363, and 542 – 78-6263 are all considered valid.
  9. Determine a regular expression to help you find the first word of each line of text with a d in it.
  10. Determine whether a string is a binary string that has the same number of 01 substrings as 10 substrings.
  11. Match all words that start with P, C, K, or with p, c, k.
  12. Match on all strings of odd length.
  13. Match on all odd length binary strings starting with 0, and on even length binary strings starting with 1.
  14. Match on all binary strings which DON’T contain the substring 110.
  15. Write a regular expression that will match on an Othello board represented as a string.
  16. Given an Othello edge as a string of length 8, determine whether there is exactly one hole.
  17. Given an Othello edge as a string, determine whether there is a hole such that if X plays to the hole, it will be connected to one of the corner through X tokens.
  18. Match on all non-empty strings over the alphabet {a, b, c} that contain at most one a.
  19. Match on all non-empty strings over the alphabet {a, b, c} that contain an even number of a's.
  20. Match on all base 3 integer strings that are even.
  21. Match on all strings where the same character is repeated 10 times in a row. (8)
  22. Match on all words where some letter appears twice in the same word. (9)
  23. Match all words where the same letter appears twice in a row. (10)
  24. Match all words where some letter appears twice in the same word. (13)
  25. Match all non-empty binary strings that start and end with the same character. (17)
  26. Match all 6 letter words containing the substring cat. (19)
  27. Match on all non-empty binary strings that start and end with the same character using look behind. (19)
  28. Match on all non-empty binary strings that start and end with the same character using look ahead. (14)
  29. Match all words that start and end with different vowels. (29)
  30. Match all binary strings not containing the forbidden substring 011. (14 with neg. look ahead; 10 without)

About

Demonstration of regular expressions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages