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
Free Tool: ZipGrep
LVL 10
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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
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
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
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
Free Tool: Path Explorer
LVL 10
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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
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
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
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.

I need to validate a date field with MM/DD/YY requirements using a regex within a cold fusion form.
0
Current code that's breaking is:

1:^(([\w\!#$%&'*+-/=?^_`{|}~;]+(?:\.[\w\-_]+)*@(?:[\w\-_]+\.)+[a-zA-Z]{2,7})[;]?)+$

Open in new window


error message:

"Error","ajp-bio-8012-exec-5","07/31/17","10:55:57",,"Invalid CFML construct found on line 214 at column 73.ColdFusion was looking at the following text:<p>\'</p><p>The CFML compiler was processing:<ul><li>An expression that began on line 214, column 69.<br>The expression might be missing an ending #, for example, #expr instead of #expr#.<li>The tag attribute pattern, on line 214, column 53.<li>A cfparam tag beginning on line 214, column 6.<li>A cfparam tag beginning on line 214, column 6.<li>A cfparam tag beginning on line 214, column 6.</ul> The specific sequence of files included or processed is: D:\inetpub\wwwroot\centralinv\central_inv_contr_verify.cfm, line: 214"

I'm guessing the # is throwing an issue and maybe the $ and ^ ... anyone have any ideas to get around the coding errors for those characters:
0
This is my current regex setup:

^(([\w\-_']+(?:\.[\w\-_]+)*@(?:[\w\-_]+\.)+[a-zA-Z]{2,7})[;]?)+$

Open in new window


I need one to allow for all of these: !#$%&'*+-/=?^_`{|}~;

^(([\w\-_']+(?:\.[\w\-_]+)*@(?:[\w\-_]+\.)+[a-zA-Z]{2,7})[;]?)+$

Open in new window


would this work:
^(([\w\!#$%&'*+-/=?^_`{|}~;]+(?:\.[\w\-_]+)*@(?:[\w\-_]+\.)+[a-zA-Z]{2,7})[;]?)+$

Open in new window

0
I'm using the following regex expression in c#.NET
   (?<![0-9])0+
It will remove leading zeros from each block of digits found and works just fine in c#.

Now, I need to do the same in Oracle sql. However, Oracle is not supporting negative lookbehind (<!)....
So, I need an alternative for
   select REGEXP_REPLACE('00AB00010', '(?<![0-9])0+') text from dual
The expected result in the above example is AB10.
0
Regular expression to accept emails w/ apostrophes ... current expression below:

^(([\w\-_]+(?:\.[\w\-_]+)*@(?:[\w\-_]+\.)+[a-zA-Z]{2,7})[;]?)+$

Open in new window

0
I need a simple REGULAR EXPRESSION that will find a specific list of numeric values.    For example;

LineByID
------------
3000
1000
3001
9991
8888

I need a regular expression that would only find values "3000" and "1000".
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.