Title: Which regex syntax?
Last modified: April 7, 2020

---

# Which regex syntax?

 *  Resolved [wikibit](https://wordpress.org/support/users/wikibit/)
 * (@wikibit)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/which-regex-syntax/)
 * Hi,
 * I’m a bit lost as to which exact regex syntax to use.
 * For example, I would like feed/posts containing 2FA or MFA or IDENTITY to be 
   assigned to a category authentication
    Test text : “This is a topic or text on
   MFA or 2FA in relation to authentication and identity management.”
 * I tried the following regex but they don’t do anything
    /(?:2fa)|(?:MFA)|(?:identity)/
   ig /2fa|MFA|identity/ig /(2fa)|(MFA)|(identity)/ig
 * but each of them work in the regex tester:
    [https://regex101.com/r/oejBrg/3](https://regex101.com/r/oejBrg/3)
   [https://regex101.com/r/oejBrg/4](https://regex101.com/r/oejBrg/4) [https://regex101.com/r/oejBrg/5/](https://regex101.com/r/oejBrg/5/)
 * Also tried the stripped down version :
    2fa|MFA|identity
 * Anyone other ideas?
 * Thanks

Viewing 1 replies (of 1 total)

 *  [cjsq24](https://wordpress.org/support/users/cjsq24/)
 * (@cjsq24)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/which-regex-syntax/#post-12822103)
 * Hello,
    I was studying your case, however we are not experts in RegEx, but you
   could try this way: **/(?:2fa)|(?:MFA)|(?:identity)/i** (without the letter “**
   g**” at the end, since **WPeMatico** processes regular expressions in php, and
   that letter at the end is part of the regular expressions in javascript). Regards,
   Carlos

Viewing 1 replies (of 1 total)

The topic ‘Which regex syntax?’ is closed to new replies.

 * ![](https://ps.w.org/wpematico/assets/icon-256x256.jpg?rev=2757072)
 * [WPeMatico RSS Feed Fetcher](https://wordpress.org/plugins/wpematico/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpematico/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpematico/)
 * [Active Topics](https://wordpress.org/support/plugin/wpematico/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpematico/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpematico/reviews/)

## Tags

 * [regex](https://wordpress.org/support/topic-tag/regex/)

 * 1 reply
 * 2 participants
 * Last reply from: [cjsq24](https://wordpress.org/support/users/cjsq24/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/which-regex-syntax/#post-12822103)
 * Status: resolved