Note that there are some explanatory texts on larger screens.

plurals
  1. POReplacing @ symbols in regular expressions
    primarykey
    data
    text
    <p>I have the following text:</p> <p><code>Title %%% info@mydomain.com</code></p> <p>I have the following script:</p> <pre><code>update: function(){ this.AjaxImage(this.mainImage.current); // /[$-/:-?{-~!"^_`\[\]]/ Updated 05.22.10, changed .replace(/%%%[^%]*/,' ') to .replace(/%%%.*/,' ') because an escaped space (%20) was causing markup to appear on the page. DE // only show the title and year below the image, %%% is the delimiter var caption = this.detailBin[this.mainImage.current] .innerHTML.replace(/%%%.*/,' '); this.overlayCaption('hide'); this.controls.counter.update(this.mainImage.current+1); this.utilities.updateHash(this.mainImage.current+1); this.captionUnderlay.update(caption); // show everything under "more info" this.captionText = this.detailBin[this.mainImage.current] .innerHTML.replace('%%%',' '); this.hasMoreInfo = (this.captionText.length &gt; caption.length+9) ? true : false; if(!this.hasMoreInfo) this.controls.captionToggle.hide(); else this.controls.captionToggle.show(); } this.captionUnderlay.update(this.detailBin[this.currentImage] .innerHTML.replace(/%%%[^@]*/," ")); </code></pre> <p>The captionUnderlay above will show <code>@mydomain.com</code>. </p> <p>I can solve the problem using the kludge below, but I want to understand what the problem is (I'm taking over the code that was written by someone else).</p> <p>If I remove <code>[^@]</code> from the regular expression, it shows everything. If I substitute <code>[^@]</code> for <code>[^}]</code> it works fine unless I have a <code>}</code> in the text. </p> <p>How do I prevent this from occurring?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload