Actually, I work in a language support for Atom (by git) and I use js regex but I must learn more about that. I need to capture on groups:
/exe c:\dos\main.cpc /l:check
I need a group with exe/
, another with c:\\dos\\main.cpc
, another with /l:
and the last with check
.
I already tried that:
(exe/)([^=]+)(/l:)(.*)
but it did not work.
Can you help me?
You forgot to escape delimiter /
Your regex should be:
(exe\/)([^=]+)(\/l:)(.*)
I suggest you test your regex on this website: https://regex101.com/
It will check the syntax for you with the explanation of every elements you use in your regex ;)
You could use this one:
(.*?)\s+(.*?)\s+(.*?:)(.*)
Here is a regex test example of that.
The logic is as follows:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.