Let H(n, r) be the set of the connected r-uniform linear hypergraphs with n vertices, where n, r >= 2. The matching polynomial of a hypergraph H is denoted by phi(H, x), where H is an element of H(n, r). Several properties on the roots of phi(H, x) are derived. We establish different expressions for phi(H, x), such as a higher-order differential formula and an integral formula. A new concept is also introduced for the weighted matching polynomials of weighted hypergraphs, for which several basic calculating formulas are obtained. Based on the results we obtained, some formulas for counting the number of perfect matchings of H are directly derived. Finally, for the weighted matching polynomials of the weighted loose paths and the weighted loose cycles, we not only obtain their recursive formulas, but also deduce their specific expression formulas.