Regex match is not greedy
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 993
- Avg merge
- 9d 21h
- Merged PRs (30d)
- 1
Description
I am trying to get the pid of my process using Expect using the regex pidof service\\r\\n(\\d+)
It seems that if the service is running and a pid is returned, Expect is able to find it.
But if the service is not running, pidof returns empty so this regex doesn't work.
I changed the regex to pidof service\\r\\n(\\d*) but then it won't find the pid at all and simply returns the string
pidof service
It seems the issue could be that the first line of the incoming string pidof service\r\n would match that regex and Expect returns success and won't process further ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file, test, or entry point is named. Start by locating the Expect and regex handling, then reproduce the pidof service\r\n cases for a running and absent service; done means the intended matching behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100