Regular Expressions: Match a or b (a|b) example

Problem:

Make a regular expression that matches I love cats and I love dogs but not I love logs.

Output:







Solution:


I love (cats|dogs)


12 comments :

  1. Thanks for posting the solution to this problem. Please do keep sharing more such basic problems and their solutions for all the beginners out there.

    ReplyDelete
    Replies
    1. Great Article android based projects

      Java Training in Chennai Project Center in Chennai Java Training in Chennai projects for cse The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Delete
  2. this would be really helpful for a programming student I learnt a couple of programming languages then gave up along the way I wish assignmentmasters.co.uk would match up to your skill keep up the good job

    ReplyDelete
  3. thaks allowed me to comment at here
    very informative post, also visit our website

    situs judi slot

    prediksi togel

    ReplyDelete
  4. buy tik tok likes Increase your exposure on social media! Check out our deals and buy Instagram Followers, Buy Youtube Subscribers, and more! Fast, cheap, and 24/7 Support.

    ReplyDelete
  5. office painting round rock With 30 years of experience, Kolor Pros Painting gives you the best results available. Our House Painters can handle any job, and can even repair drywall, or replace rotted wood trim. Call us today, and see what we can do for you!

    ReplyDelete
  6. bed bug treatment As a family-owned and run business, we take pride in assuring that we use the best products and the latest treatment methods to help deliver great results. Proudly serving residents and commercial lots of any size. Give us a call to see our pest control San Angelo services in action.

    ReplyDelete
  7. painting company round rock With 30 years of experience, Kolor Pros Painting gives you the best results available. Our House Painters can handle any job, and can even repair drywall, or replace rotted wood trim. Call us today, and see what we can do for you!

    ReplyDelete
  8. mosquito misting As a family-owned and run business, we take pride in assuring that we use the best products and the latest treatment methods to help deliver great results. Proudly serving residents and commercial lots of any size. Give us a call to see our pest control San Angelo services in action.

    ReplyDelete
  9. bed bug treatment As a family-owned and run business, we take pride in assuring that we use the best products and the latest treatment methods to help deliver great results. Proudly serving residents and commercial lots of any size. Give us a call to see our pest control San Angelo services in action.

    ReplyDelete

Follow Me

If you like our content, feel free to follow me to stay updated.

Subscribe

Enter your email address:

We hate spam as much as you do.

Upload Material

Got an exam, project, tutorial video, exercise, solutions, unsolved problem, question, solution manual? We are open to any coding material. Why not upload?

Upload

Copyright © 2012 - 2014 Java Problems  --  About  --  Attribution  --  Privacy Policy  --  Terms of Use  --  Contact