开发者

Regular Expression matching anything after a word

开发者 https://www.devze.com 2023-01-17 05:26 出处:网络
I am looking to find anything that matches this pattern, the beginning word will be: organism aogikgoi egopetkgeopt foprkgeroptk 13

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 organis开发者_运维问答m needs to be found using regex.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消