background preloader

Regex Tester - Javascript, PCRE, PHP

Regex Tester - Javascript, PCRE, PHP

RegexMagic: Regular Expression Generator RegexBuddy: Learn, Create, Understand, Test, Use and Save Regular Expression Perl Regular Expressions by Example Introduction Regular expressions are very powerful tools for matching, searching, and replacing text. Unfortunately, they are also very obtuse. You should know a little programming and how to run basic perl scripts before reading this article. Section 1: Basic matching and substitution Declare a local variable called $mystring. my $mystring; Assign a value (string literal) to the variable. $mystring = "Hello world!" Does the string contains the word "World"? if($mystring =~ m/World/) { print "Yes"; } No, it doesn't. Does the string contains the word "World", ignoring case? if($mystring =~ m/World/i) { print "Yes"; } Yes, it does. I want "Hello world!" $mystring =~ s/world/mom/; print $mystring; Prints "Hello mom!". Now change "Hello mom!" $mystring =~ s/hello/Goodbye/; print $mystring; This does not substitute, and prints "Hello mom!" Okay, ignoring case, change "Hello mom!" $mystring =~ s/hello/Goodbye/i; print $mystring; Prints "Goodby mom!". Section 2: Extracting substrings Prints "Yes". Huh? Huh?

Regular Expressions Reference - Basic Syntax The regular expressions reference on this website functions both as a reference to all available regex syntax and as a comparison of the features supported by the regular expression flavors discussed in the tutorial. The reference tables pack an incredible amount of information. To get the most out of them, follow this legend to learn how to read them. The tables have six columns for each regular expression feature. The final two columns indicate whether your two chosen regular expression flavors support this particular feature. When this legend says "all versions" or "no version", that means all or none of the versions of each flavor that are covered by the reference tables: For the .NET flavor, some features are indicated with "ECMA" or "non-ECMA". For the std::regex and boost::regex flavor there are additional indicators ECMA, basic, extended, grep, egrep, and awk. For the PCRE2 flavor, some replacement string features are indicated with "extended".

RegexBuddy: Learn, Create, Understand, Test, Use and Save Regular Expression - Regex Tutorial, Examples and Reference - Regexp Patterns Perl programming documentation Remove Skype Chat History for Single Contact Introduction I wanted to clear the Skype chat history for a single user, but Skype only allows you to clear the complete chat history, not a single user's contact history. I searched for 3rd party tools on the net but nothing worked for me on Windows 7 / Skype 4.1 At the beginning, I knew nothing about how Skype stored chat history and just entered my username and password to login and chat with friends. After spending a few hours asking Google many questions, I found that Skype was using the following SQLite database to store its messages. System Drive:\<Current User’s application data folder>/Skype/<Skype username>/main.db I tried to read it with SQLitespy, but it was a pain to find and clear messages each time. Using the Code First of all, I had to find a method to deal with an SQLite database file using C#. Reference System.Data.SQLite.dll (Located in C:\Program Files\SQLite.NET\bin\System.Data.SQLite.dll) to allow C# to deal with the SQLite database file.

MS Bots - SitePoint Premium Published January 2017 You botter believe it, Microsoft are aiming for the Skypes The Microsoft Bot Framework (MBF) and the Cognitive Services APIs allow you to create powerful bots for multiple platforms in a simple way. Using Node.js, you’ll learn how to create a Skype bot that will provide movie recommendations using the most important features of this framework. Each episode of the series will add functionality to the bot and show you different tools and techniques to take your bot development to the next level. We’ll show you how to register our bot with the Microsoft Bot Framework (MBF), and then add it to Skype.

Advanced Regular Expression Tips and Techniques Twice a month, we revisit some of our readers’ favorite posts from throughout the history of Nettuts+. Regular Expressions are the Swiss Army knife for searching through information for certain patterns. They have a wide arsenal of tools, some of which often go undiscovered or underutilized. Today I will show you some advanced tips for working with regular expressions. Adding Comments Sometimes, regular expressions can become complex and unreadable. For example, here is something we might use to check for US phone numbers. It can become much more readable with comments and some extra spacing. Let's put it within a code segment. The trick is to use the 'x' modifier at the end of the regular expression. Using Callbacks In PHP preg_replace_callback() can be used to add callback functionality to regular expression replacements. Sometimes you need to do multiple replacements. Let's look at this example, where we have an e-mail template. Notice that each replacement has something in common. Other