Brad
Brad

Reputation: 12262

Regular Expression matching anything after a word

I am looking to find anything that matches this pattern, the beginning word will be:

organism aogikgoi egopetkgeopt foprkgeroptk 13

So anything that starts with organism needs to be found using regex.

Upvotes: 13

Views: 56831

Answers (2)

Alan Turing
Alan Turing

Reputation: 56

Also just wanna add for others newbies like me and their various circumstances, you can do it in various ways depending on your text and what you are tryna do.

Like here's an Example where I wanna delete everything after ?spam so I could use .?spm.+ or .?spm.+ or any other ways as long you are creative about it lol.

This might come in handy, here's a Link | Link where you can find some basic necessary regex and their meanings.

Upvotes: 0

Ether
Ether

Reputation: 53966

^organism will match anything starting with "organism".

^organism(.*) will also capture everything that follows, into the variable that contains the first match (which varies according to language -- in Perl it's $1).

Upvotes: 29

Related Questions