Q.Is this a weed or something else?
I have had this growing in my rock walkway and have tried to pull it from the roots on numerous occasions; however, it is very difficult to pull up. I think now it may be some type of fern, but it is always in the sun and doesn’t require any care. It continues to spread. If it isn’t a weed, I would like to replant it elsewhere in my flower garden. Please help!

Garden Yarrow is a perennial Herb, that is both decorative and considered an invasive weed!
I often times allow them to flower and then pull them up shortly after to help control the spread of these plants.
Here are some articles for you.
https://www.gardeningknowhow.com/edible/herbs/yarrow/growing-yarrow.htm
https://www.gardeningknowhow.com/edible/herbs/yarrow/eliminate-yarrow.htm