Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regular Expression matching anything after a word

Tags:

regex

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.

like image 228
Brad Avatar asked Sep 21 '10 20:09

Brad


1 Answers

^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).

like image 126
Ether Avatar answered Oct 22 '22 04:10

Ether