We help IT Professionals succeed at work.
Get Started

Regular Expression, delete everything that is after or (and) before a text on a line

1,160 Views
Last Modified: 2013-11-30
so...I have this text

12 look mywebsite.com/image/dark.jpg 12 visits
13 look mywebsite.com/img/icon/1.jpg 2 visits 1 out
14 look 1 out mywebsite123.com/image/dark.jpg 1 visit 2 out

My question: I need 3 regular expressions.
1. to delete everything that is after ( lets say ) mywebsite.com
2. to delete everything that is before ( lets say ) mywebsie.com
3. to delete what is before and after ( lets say ) mywebsite.com

Thanks for the help
Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 13 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE