-1

I'm looking for a regex that matches the thank-you.aspx at the beginning of the string below and the ty=1 at the end. Those two components will always be the same, but all of the other information in the middle will be different. I am using the regex to look for these particular thank-you.aspx URLs in a database.

thank-you.aspx?source=302454&ve=60493&fn=TestName%20&ln=TestName&leadimportid=0&ty=1

4

3 に答える 3

1

私はこれがうまくいくと思います:

^thank-you\.aspx.*ty=1$
于 2012-10-02T22:07:41.543 に答える
1

^thank-you.aspx\?.*?&ty=1$

?インは、.*?貪欲でない繰り返しを持つことです。

于 2012-10-02T22:13:11.370 に答える
1

MySQL の選択の場合

SELECT db.table.url WHERE db.table.url REGEXP '^thank-you.aspx.*\&ty=1$'
于 2012-10-02T22:27:28.410 に答える