Just push the edge of the carpet down into the gap all the way across the door and trim any strings off.
Finish carpet in doorway.
I use a hook bill to do this.
If you nail one down always nail it to the subfloor and not to the pergo flooring.
You can mill your own transition strips using hardwood lumber and a tablesaw.
After the carpet is stretched onto the tack strip and cut to the correct size it needs to be tucked down into the gap.
Also tuck the carpet into the ends where the carpet meets the jambs.
But when the last few floorboards of your laminate floor need to be laid under the door jambs or through the door lining or door frame it seems impossible to get them in without.
If have to butt pergo against an existing metal track for a sliding door leave a 1 4 inch gap between the doorway and the floor and fill the gap with acrylic latex or silicone caulk.
Smooth out the carpet over the doorway and feel it with your hands to locate the area where it meets the other type of flooring.
Place a straightedge on top of the carpet and cut along the line using a utility knife to trim off the excess.