This is more of a note-to-self type of post.

You know that series of symbols and characters in a chain following each other? Sometimes you will find them with a find, replace, or find and replace function.

Examples:

  • This processes a URL:
  • somefunction.replace(/^http[s]{0,1}:\/\/[^\/]*\/?/, '/')
  • From WordPress: The following example removes all HTML comments in the first pattern, and causes a favicon (with any filename extension) to be loaded from another domain in the second pattern:
    #<!--.*?-->#s =>
    #\bsrc="/(favicon\..*)"# => src="http://mycdn.somewhere.com/$1"

Well, they are called regular expressions and you can learn more about them at some of these sites:

Any comments, suggestions, or questions? Please drop a note.

Advertisements

Posted by Rafiki Technology

We learned a ton in school, on the job, but also from great technical insights that others shared on various platforms. We are just giving it back and glorifying Jesus Christ, the Inventor of all human beings. Please note that all information shared on or through our site is of good faith and is not intended to cause any harm individuals, groups, organizations, or devices. Just to be clear: you assume all responsibility for anything you do; we are not liable for anything that should go wrong.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s