Match A String That's Not At The Start Of A Source String In Rust With nom
October 2024
The goal of this code is to find the last one.
```cargo
nom = "7.1.3"
```
use is_a;
use preceded;
use is_not;
use tag;
use multispace1;
use opt;
use not;
use tuple;
use many0;
use many1;
use IResult;
use Parser;
Output:
[/Users/alan/.cargo/target/55/19854259915251/_active_nvim_run:23:7] ids = [
"alfa",
]
This code is to find just one
```cargo
nom = "7.1.3"
```
use is_a;
use preceded;
use is_not;
use tag;
use multispace1;
use opt;
use not;
use tuple;
use many0;
use IResult;
use Parser;
Output:
alfa
Notes
-
The
optis to handle cases where the ID is the first thing in the file. Without it, it never makes it past the first character
end of line