Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

What is a regular expression for a line of text that can be either of the following:?

(a) a slash '/' followed by up to 34 characters, or

(b) 4 numerical digits, a slash '/', and then up to 30 characters

For example, valid strings are

(a) /Princess Leia Alderaan system

(b) 9021/Darth Vader

1 Answer

Relevance
  • 1 decade ago
    Favorite Answer

    [/].{0,34}|\d{4}[/].{0,30}

Still have questions? Get your answers by asking now.