# APM :: Detecting IE 11

**URL:** <https://community.f5.com/t/apm-detecting-ie-11/38243>\
**Category:** Technical Forums\
**Tags:** devops, big-ip-access-policy-manager-apm, security, tcl, vpe\
**Created:** [March 27, 2019, 8:07pm UTC](https://community.f5.com/t/apm-detecting-ie-11/38243 "2019-03-27T20:07:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_34424](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@Ryan\_34424](https://community.f5.com/u/Ryan_34424)\
**Post date:** [March 27, 2019, 8:07pm UTC](https://community.f5.com/t/apm-detecting-ie-11/38243/1 "2019-03-27T20:07:34Z")

</div>

Ok I suck, I know. But why is this wrong?

```tcl
expr { [string tolower [mcget {session.user.agent}]] matches_regex {trident\/7.+rv\:11} }

```

It never matches… even though my UA is:

```tcl
Mozilla/5.0 (Windows NT 10.0; Win64; x64; Trident/7.0; rv:11.0) like Gecko

```

I’m using an empty branch rule with this as the ‘advanced’ script above. Always hits fallback (i.e. doesn’t match).

---

<div class="post-metadata">

**Author:** ![Ryan77777](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@Ryan77777](https://community.f5.com/u/Ryan77777)\
**Post date:** [March 27, 2019, 8:24pm UTC](https://community.f5.com/t/apm-detecting-ie-11/38243/2 "2019-03-27T20:24:14Z")

</div>

Tried this too

```tcl
expr { [string tolower [mcget {session.user.agent}]] matches_regex {.*trident/7.*rv:11.*} }

```

---

<div class="post-metadata">

**Author:** ![Ryan77777](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@Ryan77777](https://community.f5.com/u/Ryan77777)\
**Post date:** [March 27, 2019, 8:33pm UTC](https://community.f5.com/t/apm-detecting-ie-11/38243/3 "2019-03-27T20:33:35Z")

</div>

I’m wondering if this is an issue with variable scope. Even something simple isn’t working.

```tcl
expr { [mcget {session.user.agent}] contains "rv:11" }

```

I’m using this in a macro, and that macro is used in a macro that is called from the main access policy post authentication.

If I go to the access policy reports and search for the session ID, I see the session variable assigned above, but it’s like I can’t call it or something…

… still digging.

---

<div class="post-metadata">

**Author:** ![Ryan77777](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@Ryan77777](https://community.f5.com/u/Ryan77777)\
**Post date:** [April 5, 2019, 5:36pm UTC](https://community.f5.com/t/apm-detecting-ie-11/38243/4 "2019-04-05T17:36:34Z")

</div>

I never figured out why, but I used a different Windows box, and it worked fine.
