Questions for regex


Regular Expression Using the Dot-Matches-All Mode

Normally the . doesn't match newline unless I specify the engine to do so with the (?s) flag. I tried this regexp on my editor's (UltraEdit v14.10) regexp engine using Perl style regexp mode:

Java Regex: Replace character unless preceded by other character

I am using Java and Regular Expressions and need to split some data into multiple entities. In my input a single quote character (') specifies an end of entity UNLESS its preceded by the escape cha...

ELisp regexp: match group if followed by other regexp

I am writing a major Emacs mode for a basic language I am implementing. I am wanting to highlight syntax for method calls where the method name is checked by [a-z][^()]* but only when followed by (...

decoding Timestamps explicitly encoded in a filename

Quite a while ago I decided to change the way filenames are formatted when users upload a file to my website(which was a great idea!) to include the UNIX_Timestamp in the filename, this proved very

Regular expressions, what a trouble!

I need your kind help to resolve this question.

Get itunes id from url

what is the best way to retrieve id from itunes app link?

Regular Expression to get comments in VB.Net source code

I have a syntax highlighting function in I use regular expressions to match "!IF" for instance and then color it blue. This works perfect until I tried to figure out how to do comments.

Regex to pluck portion of URL returning array with “undefined”

I'm making a bookmarklet for use on Google Plus. I'm a little light on my regex, but the following test almost works.

Regular Expression only allow alphanumeric plus other specific characters

With a PHP function I'm trying to create a RegEx string for preg_replace that will only allow alphanumeric characters plus ! @ # $ % & . ,

How to replace “{* foo *}” with nothing?

I want to replace all text what start with "{" and end with "}" including those "{" and "}". Text between them may be anything. =(

Regular expression for email to allow only two domain

I have to create a regular expression for email id like this

How to ‘convert’ any given regex to a PHP `preg_match`-compatible regex?

Okay, this may be a dumb question, but I’m pretty new to regular expressions and I honestly have no idea how to do this.

Regular Expression: Why am I getting matches here when I expect none?

I've a regular expression that's looking for 2-3 upper case letters, together, ending in T and beginning with P, M, C or E. The regular expression, executed in PHP, looks like this:

Regular Expression option for 3 or less characters

I have a regular expression below that works for a string example like:

Overlapping matches in Regex

I can't seem to find an answer to this problem, and I'm wondering if one exists. Simplified example:

Regex match of apostrophe in autohotkey script

I have an autohotkey script which looks up a word in a bilingual dictionary when I double click any word on a webpage. If I click on something like "l'homme" the l' is copied into the clipboard as ...

Regular Expression to Locate String With Wildcard Characters in a Non-Delimited String

I've checked every single post that I can find on here, but can't figure this out.

How can I write a .htaccess redirect to find all numbers?

I'm trying to figure out a regular expression that will find some numbers in a URL and use them in the URL I redirect to.

Can someone explain what this Email regex means


Regex: selecting between quotation marks with positive lookbehind

I'm struggling to extract data between quotation marks in the following text:

Piping (multiple) expressions in RegEx

I have a set that varies greatly in general, but I managed to find some similarities. The data may be completely different but they do have same ending classes. I am wondering if it is feasible to ...

.NET Regular Expressions in Infinite Cycle

I'm using .NET Regular Expressions to strip HTML code.

Removing information from a string

I'm using an API which uses the users IP address to find out the users Country Location and City, however I have never used regex before and I have no Idea how to extract the other information I wa...

How do I split between numbers and characters with regex?

I have a string containing on weekdays and opening hours, how do I split these into lines using a regex expression? An example of a string is:

Replace a pattern in string only if a certain condition is satisfied - Regex

how can we replace ' with \\' in a string. (this can be done using Regex.IsMatch(), Regex.Matches(), Regex.Replace()

NFA simulation in Java

I have been given an assignment to simulate an NFA in Java. Now the following regular expression that I have to simulate an NFA for is

javascript regexp replace stuff wrapped in quotes?

I know some basic regexp, but here's the thing. Every charachter will be enclosed in spans.

regex help with removing dollarFormat

trying to remove the dollar format from '$1,109,889.23'

Replace whole word with a symbol using C# Regex

So I am trying to replace a word like @theplace or @theplaces using a Regex pattern like:

Python regex: Fix one html close tag

<div>random contents without < or > , but has ( ) <div>

Parsing strings with regex into different patterns

Could someone show me a correct syntax. The complete string should consist of only numbers and characters and whitespaces in each pattern except in type. The type and one parm are mandatory. The

perl : unmatched ) in regex error

I'm no perl programmer, so I just need this simple script to run:

Using PHP how can I find a CSS tag/id/class and replace the style within the curly braces?

I need to traverse through a CSS file finding specific items and changing their CSS to updated stuff for a theme editor. I have a variable with all the CSS for between the curly braces, I just need...

Remove some characters from string

I'm scraping some items of a site and get this as response:

Extract a QString from xml tag

I have this resulted QString from an http request, What I need to do is to extract only the string "一致" which is inside the tag

Checking for file-extensions in PHP with Regular expressions

I'm reading all the files in a single directory and I want to filter on JPG,JPEG,GIF and PNG.

Telnet SMTP with expect or shell script

Want to build up a Auth Smtp Connection with expect script... just to test I wanted to get ehlo parameters but expect is not working like this

JavaScript Regex pull out only a number in an element

How would one go about pulling out just a number in the text of an element? I want to set this as a variable.

how to eval regular expression with embedded perl code

So I tested out a regular expression that utilizes the experimental embedded code features. My tests worked, so I expounded upon it to do a more sophisticated script, but ran into errors. I trace...

Problems with mod_rewrite and GET

So, I had a question earlier about mod_rewrite which you find here mod_rewrite changing /subpage/ to /subpage

Line-breaking a regexp in javascript?

As readability is somewhat absent in the below shown Regular expression literal, I would like to split it up over several lines. How would I do this and what does need to change/be escaped?

Java RegEx - Illegal character dot

String filter = "a-zA-Z0-9äöüÄÖÜß-\\.";

Regex Help, por favor

So I have a text file with comma separated numbers, I'm trying to write Python to get me the numbers three at a time - they're 3D co-ordinates and I want to analyse them 3 at a time.

htaccess rewrite incorrectly appending URL with mod_wsgi config file path

I'm currently in the process of migrating domains [old_domain] -> [new_domain].

Regex remove comments but not shebang

I got a regex that removes the comments in bash using this regex code

Trying to parse and replace pattern in Java using regex

I have tried to solve this problem for nearly 3 days. And I still don't know how to solve it.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.