Title: Code problem
Last modified: August 18, 2016

---

# Code problem

 *  [Jaxia](https://wordpress.org/support/users/jaxia/)
 * (@jaxia)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/code-problem/)
 * Anyone have a moment to help with a coding problem? I’m trying to make the acronym
   replacer case sensitive and when I follow the included instructions, I get an
   error that tells me I have an unexpected $ on line 187, but line 187 doesn’t 
   have a $. I only made two changes – I added the /// (I tried 2 and 3, neither
   fixed the problem) to this line:
 * /// $text = preg_replace(“|(?!<[^<>]*?)(?<![?./&])\b$acronym\b(?!:)(?![^<>]*?
   >)|imsU”,”$acronym” , $text);
 * and removed the slashes from these lines:
 * $text = preg_replace(“|([^./]\b)$acronym(\b[^:])|msU” , “$1$acronym$2” , $text);
   
   $text = preg_replace(“|(<[A-Za-z]* [^>]*)$acronym([^<]*>)|msU” , “$1$acronym$
   2” , $text);
 * Please help! With sugar on top?

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [ColdForged](https://wordpress.org/support/users/coldforged/)
 * (@coldforged)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/code-problem/#post-192152)
 * Some background would be helpful:
 * 1. Which acronym replacer?
    2. Which instructions?
 *  Thread Starter [Jaxia](https://wordpress.org/support/users/jaxia/)
 * (@jaxia)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/code-problem/#post-192154)
 * My apologies:
 * Joel Bennett’s, version 2.8
 * Instructions say: “Pick whichever you want, and make SURE there is only one that
   isn’t preceded by slashes: // “
 * Does that help?
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/code-problem/#post-192155)
 * Hmmm… Who is JB? 🙂
    [http://wordpress.org/support/topic.php?id=27902#post-160363](http://wordpress.org/support/topic.php?id=27902#post-160363)
 *  Thread Starter [Jaxia](https://wordpress.org/support/users/jaxia/)
 * (@jaxia)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/code-problem/#post-192156)
 * Sorry. I got this link
    [http://www.huddledmasses.org/wp-content/plugins/source.php?file=acronyms.php&justcode=true](http://www.huddledmasses.org/wp-content/plugins/source.php?file=acronyms.php&justcode=true)
 * from
    [http://wiki.wordpress.org/?pagename=Plugin](http://wiki.wordpress.org/?pagename=Plugin)
 *  [ColdForged](https://wordpress.org/support/users/coldforged/)
 * (@coldforged)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/code-problem/#post-192158)
 * Odd one, Jaxia. Here’s the fix: Instead of inserting slashes in front of that“
   OLD DEFAULT” version, do it like so:
 * `/* $text = preg_replace("|(?!<[^<>]*?)(?<![?./&])b$acronymb(?!:)(?![^<>]*?>)
   |imsU","<acronym title=\"$description\">$acronym</acronym>" , $text);*/`
 * Or, get rid of that line completely. See if that helps.
 *  Thread Starter [Jaxia](https://wordpress.org/support/users/jaxia/)
 * (@jaxia)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/code-problem/#post-192159)
 * ColdForged – Ack. Now I feel silly. I just deleted the lines and it worked. Sometimes
   the simple answer is best. I really appreciate it!
 * (But I thought lines with // in front would be ignored, too? No?)
 *  [ColdForged](https://wordpress.org/support/users/coldforged/)
 * (@coldforged)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/code-problem/#post-192160)
 * I’m a bit confused myself why the commenting out of that line with the single-
   line comment syntax causes that problem.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Code problem’ is closed to new replies.

 * 7 replies
 * 3 participants
 * Last reply from: [ColdForged](https://wordpress.org/support/users/coldforged/)
 * Last activity: [21 years, 1 month ago](https://wordpress.org/support/topic/code-problem/#post-192160)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
