Main Topics
Browse All Topics Hi,
I have the following HTML in my body
and i want to replace it with
just the inner content of em tags,wherever that em tag occur appears in the HTML it should be replaced with its inner content, like in above case:
...
I need a UNIX command, preferably a one-liner, which will perform several edits to a comma-delimited text file. For testing, I have attached the files before.txt and after.txt, which illustrate the desired output.
The command should...
Hi All,
I have a string variable like so:
string strDesc = "<span title=More of something here>Something here</span>"
This variables content can differ but the structure stays the same i.e.
"<span title=*>*</span>"
Could anyone...
How do I trim only the trailing whitespace in a multiline string?
e.g.
desired result:
Hi
I am writing an import utility for our software that can read in the XML files produced by MS Project 2003, 2007 and 2010.
I am writing this in Java using Apache XMLBeans to turn the XSD schemas into Java classes that will parse the...
Hi,
I have written a simple .NET c# application that downloads the source code of a HTML web page and reads the stream line by line.
The HTML contains many links like this:
I need to extract the link address (eg:...
I have an Office Smart Tag that uses a regular expression to match phone numbers that are in North American format. I have a user in Germany that would like me to update the smart tag to recognize German phone numbers.
The user has given me...
Hi everybody.
How do this in C# ?
int a = 30;
int b = 40;
if ((b - b) == ± 10 % of b)
{
}
or between +10 % of b and -10 % of b .
Best regards,
ocaccy
Hello,
I need some help. Id like to know how to get keywords from output like this:
So the output would be:
kony2012, psychicpebbles, oneyng, egoraptor, tomamoto, ricepirate, video, cartoon, parody, shove, rocks, down, my, dirty
Id...
I am trying to remove some malicious code from a number of files on a web site. The user account was compromised and the attacker inserted this code:
I am try to run
But I keep getting the error:
I have tried escaping...
Hello I have the following expression
^[ \t]*\$?([1-9][0-9]{0,2},([
I need to be able to modify it to accept a negative number.
Any Help is appreciated
cb
Hi All,
My Sed skill are being pulled here, and cant figure this out... i've tried backslashing, backslash with double single quotes and just cant seem to figure this out...
I need to turn this:
$config['site_domain'] = '/text1/';
...
need to create a regular expresion that finds any similars as 2_34 inside abcdef_12_34.jpg (all chars are different )
thanks in advanced
I am only looking to extract group from the text below but getting the whole pattern match. what i am getting in string is "<em>Cara Jardine and Paul Rigby</em>" where I only need
"Cara Jardine and Paul Rigby"
string html = "<p>Briefing...
i have this 4 row of data in column with Max 4 character wide:- all lowercase
abcd
acdd
cdea
abdd
how do i use regular expression to find and match the above with
1) exactly and only character 'a' 'd' 'd' ?
2) the position is Not...
Hello!
I'm trying to create a super simple regular expression! I just want to assign to a variable everything after an underscore. it will be a counter- number, then and underscore then a fedex or ups tracking code.
I'm grateful for...
I have 2 lists coming from an ini file
Jim,Joe,Bob,Frank
2891,1284,1964,1999
these are user name and PIN lists (non-critical so in-clear pwd's is ok for me)
A user selects their name and enters their PIN. I want to check name against...
I'm trying to do a match on things such as thomas. - any string ends up with a period or a comma. How should I do it? Thanks.
I want my example below to find three matches but it only finds one.
I want:
I have a regular expression with the pattern of:
^[_a-z0-9-]+(\.[_a-z0-9-]+
But lets say we have an email that ends in something like this (WHich is a very valid...
I'm testing a bunch of strings. Some of them match a pattern like /^.+\.+$/ (strings end with n dots, n > 0). For those strings, I want to split it into 1. whatever before the dots and 2. the dots.
How should I do that in Perl?
Thanks.
Hello,
I want to verify in a string various substrings. They are all in a format TEXT#RRGGBB but optinal one should be able to provide TEXT#RRGGBBTT where TT varies from 00 to FF (transparent setting).
My current code looks like this
So...
Hi guys,
I am trying to check the format of a string with reg expression
when some one enters in a number it needs to be converted to the following format
+3538xxxxxxxxxxxxxxxxxxx
where x is a number
I need to validate that a...
I have textbox which I want user to enter only numeric values (no decimals) just 1 - 9999999 whatever number and only positive.
How can I write Regular Expression Validator for this
Thanks,
How can I extend the function below to escape double quotes found in field data, eg:
"some data", "some more data with a size eg 8" where the double quotes need escaping", "some more data"
Why this in python returns empty string (no match)?
import re
print re.findall(r'[a-z]+[-[a-z]
I have no goal, just learning. BTW, do you know good tutorials in python for re?
say we have this string:
I want with the Regex.Matches to return the MatchCollection to return all the <parameter>...</parameter>
my first tries was:
which returns this:
matching the first <parameter> with the last...
What is the best way to learn regular expressions?
Should I use any software?
Thank you.
Hello experts!
Quick question, I have been searching the web to find a regex to match these possible inputs.
+ - * /
this is what I am using
This works if a user enters a single character, but if i put
=- <--- will match...
Hello,
I have a string of multiple 'blocks' of colors in Hex notation. The number of blocks can vary from 1 to 9. each is separated with one or more spaces.
eg: string with 2 block BLCK1:#222222 BLCK2:#333333
string with 4 blocks ...
I have a string - n consecutive dots ......................
I'm trying to use /^[.]+&/ to identify it. However it looks like Perl doesn't like the word boundary ^ and & - /^[.]+&/ doesn't match the string. If I remove the ^ and &, it...
I am creating a BINARY string stream that can do both input and output. I want to create a function that would give me the current size in bytes anytime I do an input or/and output when you do a read() or a write().
I have created this small...
Hello Experts,
I am learning the basics of PCRE regular expressions for mod_rewrites for Apache Web Server. I am using REGex TESTER for testing.
Id like help understanding why my regular expression will no longer find matches. I believe it...
My file is called /exports/tmp/ip789 and its content are pasted below:
# ipbackup
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:
MAILTO=""
HOME=/var/lib/backup
14 00 * * * backup /usr/lib/backup --batch...
Using PHP, how can I find the first number?
<?php
echo firstNumber('abc 123 hello 567'); // Should echo 123
echo firstNumber('5 abc 123 hello 567'); // Should echo 5
echo firstNumber('abc hello'); // Should not echo anything
?>
So I want to do some in php, I get a text from wordpress that contains certain links, so what I want to do is first get all the files matching the following
http://www.anydomain.tdl/w
And...
I've got the following code where I'm trying to remove the content before the image tag and after, leaving only the image tag. So far, the content before the image tag is properly being deleted, but the content after the image tag is still...
Hello,
I am not that experienced in regex and I struggle with the following
This code should accept TEXT:9:TEXT or TEXT:99: or TEXT:2:"TEXT" but should not accept
TEXT:9 or TEXT: or TEXT.
The regex I have here does accept...
Hi,
Have a reg expression which searches through the contents of an email body and any link it finds it adds a string after it for analytics tracking
Problem at the mnute is that it is also adding it after email links which start <a...
Experts,
I have a problem..I need to allow following characters ( space, hyphen -, forward slash /, back slash\, apostrophe' ) in my textbox and validations has to pass. I achieved through regular expressions. Whether these special...
Hi
I'm storing html in a database field. Users can edit the html, and see a the first part of the document in a preview box.
If users use a large font size (60 & above) if distoys the preview. How would I remove the users font size, and...
In python, I would like to bracket a word in a string if it follows another,
for example:
string = "one two three four"
replace with: " one two (three) four"
here I am looking for the word "two" and bracketing the next word.
Some code I...
I'm using the following regex to match a word.
The problem now is although I've been using the word boundary (\b), I can still match words such as #sell or sell@.
Is there a way to avoid matching those with punctuation marks? Thanks.
I have two different strings that I'm trying to match and replace underscores with dots.
example 1: widget_xy15021_midwest_201
example 2: widget_xy15024_midwest_1of
I have two different expressions matching each...
Hi,
Goal: prefix each number in a string with 1-5 zeros depending on the number
e.g. if it's less than 10 then prepend 4 zeros, if it's two digits then prefix three zeros.
This basically prefixes each number with zeros so each number is 5...
Using JavaScript, how can I remove all HTML entities?
Using ASP.NET / VB, how can I automatically create email links from a static text?
The following code works in PHP but I need it converted to ASP.NET / VB.
I use the following code to make email addresses links.
The problem is that periods and commas and single quotes and double quotes mess things up.
I use the following code to make links clickable where the link begins with www.
The problem is that this becomes clickable links:
zwww.example.com
/www.example.com
>www.example.com
It should ONLY become a clickable link if it...
Hi im trying to extract domain usernames from my juniper log files using regex however depending on the log message the fully qualified domain name isnt always displayed
See example below:
line 1: juniper -ive -] domain/user1(realm)...
I want to replace a dash with a bullet if it is at the beginning of a line.
The problem with my code is that it does not work on the first line. It works for all lines except the first line.
This:
- Hello world
- This is a test
- Item...
Hi All,
In C# I have the following variable that tests for the following matches... ' not ',' and ',' or '.
This seems to work fine when locating matches for ' not ' and ' and ' but it doesn't work when locating the keyword ' or '.
Can...
Using ASP,NET, VB and REGEX, I want to automatically create twitter links from this:
(@xyz) where xyz is the twitter username.
The problem with the code below is that it returns this:
<a href="http://twitter.com/(
...
I am tryin to use a regular expression to validate that my decimal has no more than 4 places after the decimal.
I tried the code below, but even when I use a number like 2.23456 it still comes back as success=true...what am I doing wrong?
...
Can you help me look at what is wrong?
I test "testhui2" but found
match.Success = false;
Why?
Using JavaScript, how can I get the first number that is larger than 1000?
I have attached an example to work from:
Hi I want to do redirects using reglar expressions in my web config.
If a request comes to any of these
http://www.mysite.com/myfa
http://www.mysite.co.uk/my
http://www.mysite.com/uk/m
redirect to ...
Using ASP.NET and VP and REGEX, how can I make links beginning with http:// and https:// HTML links?
http://example.info
should become
<a href="http://example.info"
I would like the code below to be modified:
I'm using the following regex to replace text in between curly brackets {}:
preg_replace("/\\{(\w)\\}/
But I need to allow underscores and hyphens _-. How would I change it to allow for multiple hypens and...
Hello Experts,
I need a regular expression that will force the user to enter ether:
1) a zero
2) a ten digit number
So this needs to be numeric only, no spaces, dashes, ect.
Thanks!
Moe
I'm trying to write a script that will parse out a list of file names and check them for illegal characters. I figured I'd use some sort of regular expression for it, because it seemed like the easiest way to go, but I'm not sure what that string...
I need to load a list of search-and-replace patterns (with backreferences) in from a config file and apply them to a series of strings. I can't figure out how to do a search-and-replace with backreferences using variables.
This is the RESULT...
([A-Za-z0-9]+)
I am using this above regex to validate a string with text and numbers... I need to include a rule so if this has any ? or = mark in the string reject it...
can anyone help pls?
Hi Experts
I have a list of urls
airpurifiersreviews.net
airpurifiersreviews.net/
airpurifiersreviews.net/
airquality.weather.gov
airquality.weather.gov/
airquality.weather.gov/
austinair.com/products/hea
Hello All,
I have the regex listed below for removing HTML and therefore just displaying the text --
However when I run on data that starts -
I get -
"<p style="margin: 0px 0p..." as the output.."
I should be getting this -...
Hey guys,
I'm a little confused at how to approach this particular function. What I have is a string like this:
What I'm looking for is a function that can randomly pick an element from within the { } but delimited by the |.
Example...
Hi,
Probably a simple one for someone.
I need a regular expression that returns the content inbetween two strings.
I have a file (an sql file) with the following string within it in multiple places throughout the file (400 times)......
What would the REGEXP be for matching any character except letters? So basically I'd want to match all numbers and all special characters such as ! and @ but I wouldn't want to match letters.
This is part of my MySQL query that I have right...
I would like to remove All Lines NOT containing a specific string using Regular Expression
For example I have 100 lines, I would like to filter the lines which contains only the word let us say "IND" and delete all the other lines. How can we...
Can someone provide me with a good free tool to parse out data from an Apache Tomcat server log.
Of course Google provides a billion results, but I'd like a to sort through the list quickly.
Something in Perl would be best suited.
I'm...
I have thousands of mp3 files bought from various places. My folder file list looks something like this:
Mental Project - 6000 (Roman Gertz Shocked Remix).mp3
714225_-_Looks_Good_Origin
01_-_Why_Not_(klang123ltd)
I'm looking for a regex to parse my error log. The log is in this format:
[04-Mar-2012 23:23:12] Warning: trigger_error 'this is the error' using GET to http://www.someurl.com on line 7 in trigger_error()
I'm trying to pull it out so that...
I'm trying to clean up a WordPress to Joomla conversion of about 9,000+ articles and I know that I can use regular expression and pattern matching to do it rather quickly but I'm short on time to read through my O'Reilly Regular Expressions book....
Do I have to escape the '$' in order to make this find the string in this snippet of data?
align=right> <b
The data is there, but Regex is not finding it... this is my expression:
I'm fairly new to RegExp and can't for the world figure this one out.
In my project (.NET) I have to make a search engine where one single string is entered into a search box.
Example input where I THINK I have included all possible...
Using PHP, how can I automatically make a file name original by adding an underscore and a number to the end?
If you run the script 12 times, the files saved should be named:
hello.txt
hello_1.txt
hello_2.txt
hello_3.txt
hello_4.txt...
When using ASP.NET / VB, how can I add new lines in the following?
This gives an error:
Hello EE,
I have a string like this :
GR_Hello
and could be also:
GL_21388-30 ( This is a Test )
It will always be GR or GL at the beginin following a underscore then after its unique
What would the regex pattern be ?
If...
I need a simple regex for the following string
Brad-233
so here it's firstname-last 3 chars of id.
Can someone pls help here...?
Hi,
I am not real handy with regular expressions. I am picking up some code to verify a date using the following regex:
^[01][0-9]/[0-3]\d/\d{4}$
Can some decode what iti is doing?
Thanks in advance,
hefterr
I am having trouble understanding how I can use regular expressions correctly. I have the following text:
<a href="files/anna <span class='ContextText'>test</
I would...
Can anyone enlighten me to the Regex pattern needed to check for the existence of a pipe character in a RegularExpressionValidator
Basically, validation should fail if the | character exists anywhere in the text of the control.
My attempt...
Hi.
Can somebody help me with a regular expression?
I need to find the value between 2 strings in a string.
Ex.
<span>Your ordernumber is: xxx</span>
Dear xxx, <br />
What I need to find in the stings is the xxx.
Using REGEX with ASP.NET / VB, how can I format this:
Any text that is immediately after a line break (or at the very beginning) should be bold if there is a colon in the first sentence, from the beginning to the colon.
This should be...
I use the following ASP.NET VB REGEX to automatically make headings bold.
The problem is that the first heading is not made bold because it does not begin with a new line.
This should only require a new line to work AFTER the first line.
Hi,
I need help with a regularexpression to match the string 'test'. I do not want to match 'test' if it is preceded by the string 'no'. I do want to match 'test' if it is preceded by the string 'no' if 'no' is followed by 'yes'.
so far...
Hi All,
I need to identify any 1 instance of a string within a large string that begin with the character  or â for example – or ±
Could anyone suggest a means/syntax to achieve this?
Thanks,
Rit
Experts,
We have two servers. The first one, which is a Win2003/IIS6 Coldfusion based server, and currently holds our foremost domain name (URL) and company site. It also holds numerous 'virtual' subsites that are delineated by...
Hi,
I'm using the cfserialize command in Coldfusion to output some data into JSON format. In the developer edition of CF it works perfectly but in a hosted environment running enterprise it's not running correctly even though everything...
Hi Guys and Gals
Regex question. (I'm terrible at creating them).
I have a directory containing a list of files. I want to test this list to whittle down to relevant files and then find the file with the latest version number.
So for...
Hi to all,
I am looking for a regular expression that will remove everything before the last slash in the following string:
https://mysite.com/OfficeS
That will leave me with just the following:...
I think my other question might have been somewhat confusing. Maybe someone can give me a hand with this explained a little bit differently.
I have these files in a directory:
articles.php
articles-how-to-eat-light.
I use this code to put matching links into an array:
I want the words: " My Link" to be added inside the anchor text for each link, so my array should look like this:
What would be a regular expression for "find word A not followed by word B,C or D."?
I have strings like the following:
1.2x...
super...
For both string, I want to extract the part before the ... so, for the first one I want the string splitted into 1.2x and ...
For the second I want to split the string into super and ......
I have downloaded REGEX Buddy...cool tool. Using solely the GREP engine provided in this helper application, I want my search to return any phrase that occurs between the phrases "APPLIES TO:" and "POLICY:". These are headings in a document...
Hello Experts!
Does anyone know a PHP expression (using regex) to extract the numeric portion of an international street address?
Thanks!
Hi All,
I have a piece of software which converts Excel to HTML (sparing you the detail!)... This produces a mass of markup (5000 lines on average) and all I am interested in is just any html input tags.
Can anyone suggest a means of...
I am trying to build a regex to check an email address
/\w+([-+.']\w+)*@\w+([-.]\
works fine, but i only want it to accept up to 256 chars.
something like
/\w+([-+.']\w+)*@\w+([-.]\
...
Hi,
Lets stay i have a string that contains the following
<model>123456789</model>
Is there a way to trim the value inside this tag using regex? Ie if i want to set the limit to be 5 chars
my output would be <model>12345</model>
...
kaufmed
137,916
Master
70 points yesterday
ProfileTerryAtOpus
50,832
Master
0 points yesterday
Profilefarzanj
29,324
0 points yesterday
Profileozo
15,408
0 points yesterday
ProfileRay_Paseur
13,176
0 points yesterday
Profilewdosanjos
11,800
0 points yesterday
Profileahoffmann
10,800
0 points yesterday
Profilebounsy
8,600
0 points yesterday
ProfileMichaelStaszewski
8,372
0 points yesterday
Profileleakim971
7,000
0 points yesterday
ProfileStingRaY
6,000
0 points yesterday
Profilefor_yan
5,000
0 points yesterday
Profilepfrancois
4,448
0 points yesterday
Profiledcsbeemer
3,500
0 points yesterday
ProfileCodeCruiser
3,414
0 points yesterday
ProfilePaulHews
3,400
0 points yesterday
Profilewoolmilkporc
3,252
0 points yesterday
Profilearnold
3,000
0 points yesterday
ProfilePryrates
2,800
0 points yesterday
ProfileVaulden
2,800
0 points yesterday
Profilenepaluz
2,664
0 points yesterday
Profilexterm
2,600
0 points yesterday
ProfileHonorGod
2,600
0 points yesterday
Profilesentner
2,600
0 points yesterday
Profilematthewspatrick
2,400
0 points yesterday
Profile