Hello,
I have a series of text fields, which I need to clean of all full stops. The input text is company names, which sometimes contain abbreviations and sometimes full stops for other reasons.
I would like to remove the full stops when the text is an abbreviation, otherwise, I would like to replace it with a space. I would define a...
I have a C# project I'm intending to port to Objective-C. From http://stackoverflow.com/questions/422138/regular-expressions-in-an-objective-c-cocoa-application, it looks like there's a confusing variety of Regex options but I can't see anything about a way of doing a replace with callback. That is, the equivalent of the C# MatchEvaluato...
r'(^|^A)(\S+)(B$|$)'
results to matches everything, which actually equals to ^\S$.
How to write one matches "begins with A or ends with B, may both but not neither?"
PS: I also need refer to group (\S+) in the substring module.
Example:
Match Aanything, anythingB, and refer anything group in the replace.
...
I'm looking for a regular expression for one of my particular requirement explained below. I believe that this may be very simple & basic for the regex experts.
A regular expression that matches one or more words in a line. Consider this line:
QRYNUMB0007 = SELECT EMPLOYEEID, FIRSTNAME, LASTNAME, EMAIL, CITY, STATE, COUNTRY FROM EMPL...
I have a problem with regex, using preg_match_all(), to match something of a variable length.
What I am trying to match is the traffic condition after the word 'Congestion' What I came up with is this regex pattern:
Congestion\s*:\s*(?P<congestion>.*)
It would however, extract the first instance all the way to the end of the entire ...
The last time I used a regular expression was 2 years ago and even then it wasn't something I considered to be the simplest of things!
Could anybody tell me how I would go about splitting this text into three groups (qty, name, price)?
1 Corn Dog 5.00
3 Corn Dog 15.00
@ 5.00
2 Diet Cola 4.00
...
echo $ul; // gives this code:
<ul id="menu">
<li id="some_id" class="some_class">...</li>
<li id="some_id" class="some_class">...</li>
<li id="some_id" class="some_class">...</li>
</ul>
How to add some class for the first and the last <li>?
Need a regex solution.
echo $ul; should give (if we add class my_class for the last <li>):
<...
Hi
I have updated my website to now use the codeigniter framework my new urls are like the following example.com/index.php/home/page/page-title
The old urls are example.com/index.php?option=com_content&view=article&id=249
Ideally I want to do a redirect for all links formatted in the old way to the new links but there are a lot of pag...
I'm not a pro with regexp and especially in this specific context. Any idea how to use a function to do a RegExp Replace and then calling it from the query in Microsoft Access?
By the way, this query oddly enough doesn't work fully and maybe it's why this could use regexp.
The idea is to match the three fields in the temp_table query:...
I've searched the questions but can't find an answer. I need a pattern that, used with php preg_match function, only match strings that does not contains 3 or more consecutive digits, e.g.:
rrfefzef => TRUE
rrfef12ze1 => TRUE
rrfef1zef1 => TRUE
rrf12efzef231 => FALSE
rrf2341efzef231 => FALSE
So far, I have wrote the...
someText
1
2
3
4
moreText
I would like to add a prefix before each digit.
but using (\w+\R)(\d+\R)+(\w+) and \1prefix\2\3 will only prefix the last digit and erase the others.
Is there a way to do it with a single regex or should i write a script on the side?
...
Just a quick one here, does anyone know of a good regular expression for a percentage? Including 2 decimal places, i.e. 15.22%. I'm looking to put it inside a regularexpressionvalidator in ASP.NET.
Thanks
...
Hello all,
I want to match roman numbers using Groovy regular expressions (I have not tried this in Java but should be the same).
I found an answer in this website in which someone suggested the following regex:
/M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})/
The problem is that a expression like /V?I{0,3}/ is not greedy in ...
Can anyone tell me why, even when my alert shows that my regular expression strings match, the if statement is not triggered? I have sample code below. Thanks in advance.
$(document).ready(function () {
$('div#primaryNavigation').find('a').each(function () {
var pattern = /my-link1|my-link2|my-link3|my-link4/;
var my...
I need to remove everything after the last '/'.
Source: /uploads/images/image1.jpg
Result: /uploads/images/
How do I do this with regular expression?
I've tried different solutions, but it's not working. I get NULL as a result.
...
I am using google analytics and have a filter for one of the websites to exclude traffic that is not within an IP range, but I am creating a new profile, to track all that traffic within that IP range. This will allow me two different profiles, one to view all traffic that is on campus, and another to view all traffic excluding campus-tr...
Folks,
I have method that returns true if all characters are "legal" and false if a single character is "illegal". The definition is below (legal = letters, numbers, and some characters like $, - , %, etc). I want a newline and/or carriage return character to be "illegal". However, the method below thinks that its legal. How can I f...
I'm trying to extract src value from image tag using prag_match with perl pattern. I don't know where I'm making wrong but, I'm getting unwanted part as well. Here's how my pattern look like -
preg_match_all('#src="http.+"#',$imagetag,$temp);
$imagetag = "<img src="http://....." alt="build4.jpg" title="build4.jpg" width="320" height="2...
I'm a bit rubbish with Regex and was wondering if some kind person would be happy to assist!
The format is:
optionally 1, 2 , A or B
Day Name, possibly short or full, eg
Mon, Tuesday, Thursday, Fr
Colon : or Space
Integer
The following are valid:
EDIT: included "Mon:20"
Mon:3, Tuesday:6, AWe:9, 2Fr:2, 2Wed 3,...
One of my favorite features of Eclipse is the ability to open a caller/callee hierarchy of a method.
By default, the view shows calls to/from classes that are outside of my codebase... which I don't usually care about.
There is an option to filter out specific package names I don't want, but I need to do the opposite... to filter out a...