Help me with this regex please

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Help me with this regex please

Post by klevis miho »

I want to get from this string:

- Mtv commercial - abu & quiz: the knight rider (teletext pag. 528) - 777 - 778

this string:

Mtv commercial - abu & quiz: the knight rider
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: Help me with this regex please

Post by klevis miho »

with this expression: /- ([^(:-]+)/
that AbraCadaver gave me in one of my posts, I have this result:

Mtv commercial


and with this one: /\- (.*)[ \(.*| \- 77.*|]/
I have this result:

Mtv commercial - abu & quiz: the knight rider (teletext pag. 528) - 777 - 7
Post Reply