Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x

Regular Expressions

A regular expression ("regex") is a sequence of characters that define a search pattern, mainly for use in pattern matching with strings, or string matching, i.e. "find and replace"-like operations. Regular expression processors are found in several search engines, search and replace dialogs of several word processors and text editors, and in the command lines of text processing utilities, such as sed and AWK. Many programming languages provide regular expression capabilities, some built-in, for example Perl, JavaScript, Ruby, AWK, and Tcl, and others via a standard library, for example .NET languages, Java, Python and C++ (since C++11). Most other languages offer regular expressions via a library.

Share tech news, updates, or what's on your mind.

Sign up to Post

regex code to delete this lines: $HEX[

vipsa@7181
$HEX[6d65676164c3a17361]
$HEX[6c65796c61617964c4b16e]
irfan_1993_figo@hotmail.com
$HEX[31c2ba62616368696c6c6572]
$HEX[7365766563656e6dc4b1]
$HEX[6e657372696e736172c4b1]
askim_22_95
$HEX[d183d0bbd184d0bbd184d0bbd184]
roro.love.9
selimozel.1
chi1610@aj

Open in new window

0
Important Lessons on Recovering from Petya
LVL 10
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Hi,

  I have a windows folder which contains a number of text files.
I need to find out a list of words starting TRP_     and ending in space, from all these documents.

Is there any way to achieve this?
Please help.
0
Hi,
I have 2000 small HTML files and I want to replace something, or actuallr remove something.
I found EmEditor which I like a lot. It has some regular expression search. But I cant figure out how to solve my challange.

I have a piece of html code:
<a style="font-family:Arial; font-size:12px; " href="photo_send.php?id=???">Request high resolution photo</a><br>

very simple, I want to remove this line. However where you see ??? there are numbers in there from 1 to 2000. So I try to find a way to tell the find/replace to ignore on the find what is between the id= and the "

Any ideas on how to accomplish this?

Thank you for any tip.

Thom
0
Hello,

I need a regular expression that will find lines that:

1. begin with ResourceDescription
2. contain consecutive double quotes ("")

Thanks in advance!
0
I have a report that works with a regex and validates well enough w/ the regex. The client is asking to force the date field to be all caps though. I can add the style -  style="text-transform:uppercase" - to force this but when I do it throws an error. Anyone have any idea why this would happen? code below:
<cfinput type="text" 
                                          name="period" 
                                          validate="regex"
                                          pattern="^(JAN|FEB|MAR|APR|JUN|JUL|AUG|SEP|OCT|NOV|DEC)-(19|20)[0-9]{2}$" 
                                          message="Please enter the Accounting Period in the correct format, i.e. MON-YYYY." 
                                          required="true"
                                          id="period"
                                          class="Headline12DrkBlu" 
                                          size="10" 
                                          maxlength="8"
                                          default="#period#">

 But if you add the style to force the all caps it errors out: 

            <cfinput type="text" 
                                          style="text-transform:uppercase"
                                          name="period" 
                                          validate="regex"
                                          pattern="^(JAN|FEB|MAR|APR|JUN|JUL|AUG|SEP|OCT|NOV|DEC)-(19|20)[0-9]{2}$" 
                                          

Open in new window

0
Regexcode:Numbers, uppercase and/or Lowercase doesn't matter and which necessarily contains one or more of these symbols:

_!@#$%^&*.,?

I use word list updater 2.7 for windows os
thanx!
0
input file:

1 geani
1 mami
1 sally

output:
geani
mami
sally


i need a code for wordlist update2.7 , notepad can't help me the file is too big, thanks!
0
e.g.:

 brandon
   smich
marl
      siracusa
   sabine

Open in new window


output
brandon
smich
marl
siracusa
sabine

Open in new window


i use Word List Updater 2.7   for windows os
0
What is the TPX pantone number for 365c
0
Hello Experts,

I am trying to get the 8 digit Alphanumeric value from the below string. Please help..

rak45551
is string I am interested in.

CN=James Kera rak45551,OU=SOA,OU=End-Users,OU=KAL-Users,DC=KAL,DC=British,DC=com

Open in new window

0
Keep up with what's happening at Experts Exchange!
LVL 10
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

i have inherited some VB.Net  code...
there are explicit line number labels in the code...

the problem is that the line they are supposed to be associated with is on the next line   ...

  so it looks like this

1350:
                      Slots = Slots +1

when it should look like this

1350:            Slots = Slots +1

so i need to find all ....: that have N spaces followed by a CRLF

and replace it with ....:
with nothing after the :

i have looked at using the regular expression stuff.. and have found some things that find blank lines.. but these lines are not blank....

edit: ----------------------------------------------------------------------------------------------------------------
----the pattern i am looking for .... i believe...   is a colon followed by a newline

i put in \n   it finds the end of every line
i put in [:]  it finds every colon
but i put in [:]\n... and it doesn't find anything


TIA
0
regular expresions for this?


120.10.10.90@username;password
90.250.250.9@admin;john
etc..

window sos ,i use worlist updater 2.7
0
Hi Experts,

I want the Regular Expression to capture the text (let's call that <datName>) in front of the text ".DatabaseName",
then to add a new line starting with <datName>:

<datName>.Connect = gstrdbConnect

So where you find something like

<datName>.DatabaseName blah blah

you add a line:

<datName>.Connect =  = gstrdbConnect

So for example, if the unedited text is:

..........................
    datLoadGroups.DatabaseName = gdbLoads.Name 'strDataPath & "\loads.mdb"
..........................
    datElasticMaterials.DatabaseName = gdbLayers.Name 'strDataPath & "\layers.mdb"
..........................

Open in new window



The edited text should be:

..........................
    datLoadGroups.DatabaseName = gdbLoads.Name 'strDataPath & "\loads.mdb"
	datLoadGroups.Connect = gstrdbConnect
..........................
    datElasticMaterials.DatabaseName = gdbLayers.Name 'strDataPath & "\layers.mdb"
	datElasticMaterials.Connect = gstrdbConnect
..........................
	

Open in new window

Thanks,

Regards
Leigh
0
Hi

Can anyone help me with the regex to highlight the section of a string including and after a set of characters.

For example for the string

Assfgghh./.../.../https://654321

I want to only extract

https://654321

The length and values following https:// vary in length and character types.

I am calling regex using Python.

Many thanks
0
Hi:

In Notepad ++ I want to search and replace a string 'ABC' (the single quotes are legit replacements) with :ABC, but seem to find that the editor isn't able to find the string 'ABC' , only finds ABC (no single quotes).

How do I get it ti find the ABC with single quotes? I tried "'ABC'" and ''ABC'' but no luck
0
I need a regex to force a date form field to be all caps with a dash and YYYY format, i.e. JAN-2017, FEB-2017, etc
0
I use word list updater2.7 for windows os and i want to fiilter this: https://pastebin.com/zzTSgCrM
to this: https://pastebin.com/VnMF6MCH
thank you
0
regex code to delete all email.ru:blah123 lines
e.g.:
name1@yamiail.ru:ravecca
name2@yahoo.uk:mam@123
name3@mail.ru:ravini

output:
name2@yahoo.uk:mam@123

i use Word List Updater 2.7 for windows 7
0
I need a gawk code to remove this type of duplicates:

john:john
mary:1234
sdfds:sadfsf
john:john
mary:1234

Open in new window

0
Tech or Treat! - Giveaway
LVL 10
Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Can you change this so it uses and .oft as the email sent? I have attachments i want to send along with it.


' ExpertExchange Question ID 28492433
' http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/Q_28492433.html
' Expert: ltlbearand3 [http://www.experts-exchange.com/M_2469312.html]
'
' -------------------------------------------------------------------------------
' MUST HAVE A REFERENCE TO:
'   Microsoft VBScript Regular Expressions 5.5
' -------------------------------------------------------------------------------

Sub CustomMailMessageRule(Item As Outlook.MailItem)
    Dim objRegEx As VBScript_RegExp_55.RegExp
    Dim colFoundWords As VBScript_RegExp_55.MatchCollection
    Dim objOutlookMsg As Outlook.MailItem
    Dim objOutlookRecip As Outlook.Recipient
   
    ' Set up Regular Expressions to search for the email Address
    Set objRegEx = New VBScript_RegExp_55.RegExp
   
    ' Search for Matching Email Addresses
    With objRegEx
        .IgnoreCase = True
        ' Set Global to False to only find the first instance as there could be more than one if they sent the email
        ' and it turned it into a link
        .Global = True
        ' This pattern will look for an email address - see http://www.regular-expressions.info/email.html if you want to know more
        .Pattern = "Email\sAddress:\s\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b"
        ' Run the Search
        Set colFoundWords = …
0
i have a huge txt file and i want to extract all words wich contains  --> @123
i have windows 7 and i use: Word List Updater 2.7 to filter my lists
0
What I am after is a regex that returns a value that is a suffix of:

Client #: 123456

Desired returned value is 123456
Is this possible?
2
We are witnesses that everyone is saying that our children shouldn't "play" with a technology because it is dangerous. This article is going to prove that they are wrong.
1
Is this regex a valid tester for MM/DD/YY? I'm assuming its going to miss leap year and 06/31, 08/31, etc.
'[0-1][0-9]/[0-3][0-9]/[0-2][0-9]'

Open in new window

0
I need to validate a date field with MM/DD/YY requirements using a regex within a cold fusion form.
0

Regular Expressions

A regular expression ("regex") is a sequence of characters that define a search pattern, mainly for use in pattern matching with strings, or string matching, i.e. "find and replace"-like operations. Regular expression processors are found in several search engines, search and replace dialogs of several word processors and text editors, and in the command lines of text processing utilities, such as sed and AWK. Many programming languages provide regular expression capabilities, some built-in, for example Perl, JavaScript, Ruby, AWK, and Tcl, and others via a standard library, for example .NET languages, Java, Python and C++ (since C++11). Most other languages offer regular expressions via a library.