You can use such a step as a nested element of the <steps> element in your WebTest ANT file.
Ex: permits to retrieve "123" or "plouf" in a link with href="toto.jsp?titi=123&tutu=plouf".