# iRule coding

**URL:** <https://community.f5.com/t/irule-coding/19745>\
**Category:** Technical Forums\
**Created:** [June 17, 2014, 4:10pm UTC](https://community.f5.com/t/irule-coding/19745 "2014-06-17T16:10:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ReynaldoQ\_14206](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@ReynaldoQ\_14206](https://community.f5.com/u/ReynaldoQ_14206)\
**Post date:** [June 17, 2014, 4:10pm UTC](https://community.f5.com/t/irule-coding/19745/1 "2014-06-17T16:10:49Z")

</div>

Hi…don’t know much about coding in F5 just wanted to verify if this works as a negation (!) as in below.

elseif { [matchregion ldns !“BXB-IDMS-DNS”] } { if { [active\_members pl\_chi-mysql-read.gtm.intdata.com\_3306] \> 0 } {…

```tcl
Thanks

```

---

<div class="post-metadata">

**Author:** ![Cory\_50405](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@Cory\_50405](https://community.f5.com/u/Cory_50405)\
**Post date:** [June 17, 2014, 4:17pm UTC](https://community.f5.com/t/irule-coding/19745/2 "2014-06-17T16:17:54Z")

</div>

I believe you’ll need to move the not outside of the braces:

```tcl
elseif { not [matchregion ldns "BXB-IDMS-DNS"] } { 
 if { [active_members pl_chi-mysql-read.gtm.intdata.com_3306] > 0 } {....

```

---

<div class="post-metadata">

**Author:** ![ReynaldoQ\_14206](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@ReynaldoQ\_14206](https://community.f5.com/u/ReynaldoQ_14206)\
**Post date:** [June 17, 2014, 4:24pm UTC](https://community.f5.com/t/irule-coding/19745/3 "2014-06-17T16:24:02Z")

</div>

Thanks Cory. Shall I use the “not” or “!” or either will work?

---

<div class="post-metadata">

**Author:** ![Cory\_50405](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@Cory\_50405](https://community.f5.com/u/Cory_50405)\
**Post date:** [June 17, 2014, 4:27pm UTC](https://community.f5.com/t/irule-coding/19745/4 "2014-06-17T16:27:43Z")

</div>

Either one will work. Sometimes it’s easier to understand upon glancing at it when you spell it out instead of using symbols. End result is the same though.

---

<div class="post-metadata">

**Author:** ![ReynaldoQ\_14206](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@ReynaldoQ\_14206](https://community.f5.com/u/ReynaldoQ_14206)\
**Post date:** [June 17, 2014, 4:30pm UTC](https://community.f5.com/t/irule-coding/19745/5 "2014-06-17T16:30:09Z")

</div>

thank you very much.
