-1

I have lines like these

abye/>abye
abys/>abys
aced/>aced
aces/>aces

I want it like this

abye
abys
aced
aces

Is it possible? If it is then please someone show me the way.

2 Answers2

1

The below regex would remove all the characters from start upto the />

Regex:

^.*\/>

REplacement string:

Empty string

OR

The below regex would remove all the characters from /> upto the end.

Regex:

\/>.*$

Replacement string:

Empty string

Pattern Explanation:

  • \/> matches the literal /> symbols.
  • .* matches any character but not of new line character.
  • $ End of the line.

By replacing all the matched characters with an empty string, you get only the part before />

Avinash Raj
  • 172,303
  • 28
  • 230
  • 274
0
^(.*)(?=\/).*$

You can try this.Replace by

$1.

See demo.

http://regex101.com/r/jT3pG3/32

vks
  • 67,027
  • 10
  • 91
  • 124