Regular expressions (often shortened to "regex") are a declarative language used for pattern matching within strings. Please also include a tag specifying the programming language or tool you are using.
1
vote
1answer
23 views
awk code to get specific lines in a file
I have a file Query.txt with data like this:
# Query: Name_ID
# 2 hits found****
# Query: Name_ID
# 20 hits found
# Query: Name_ID
# 0 hits found
when I awk it or grep it for a ...
0
votes
0answers
18 views
PHP: Regular expression / preg_match() until EOL
in a html page is a line like this:
<p><strong>State:</strong> <a href="/state/show/Ohio">Ohio</a></p>
What i'm looking for is a regex which gets the content ...
0
votes
0answers
8 views
is it possible to use google analytics' regex search to find matched search queries that don't have specific words?
I want to do a search on "matched search queries" in google analytics so i can find all search results people use to come to my site that don't exclude certain words. For instance, lets say I made a ...
1
vote
3answers
27 views
trying to find text with wild card integers inside a string in a special format in Python
I have a piece of code that opens a file and iterates each line
inside the formated text file there will be a piece of text like this:
name.x00y00.whatever
I searching for the x00y00 to see if ...
3
votes
1answer
46 views
Regex find token value in .NET
I need some help from someone that is better in Regex than I am :)
I am trying to find the values of specific tokens in a string using .NET (C#)
The string I have has tokens like this one ...
1
vote
1answer
10 views
using awk in tcl script
I want to print a particular column number fields in a file while in TCL script.
I tried with exec awk '{print $4}' foo where foo is filename, but it is not working as it gives error
can't read ...
0
votes
1answer
42 views
Finding file paths in a string
I modified gnome-terminal and added support for a custom url handler: src://
It lets you jump directly to line number in a file when you ctrl-click.
example src:///path/to/file:43
This is all good, ...
0
votes
0answers
24 views
PLSQL: delete patterns in a string
I got a string like this :
'DISTINCT DECODE(java_api_name,NULL,initlower(process(object_name)))
,NULL,field_description,NULL,NULL'
I want to delete the ",NULL " in the string except the one ...
0
votes
2answers
29 views
apply regex only when a character is not at start and end
I am trying to find and replace PHP variables in PHP files from vb.net. I successfully do this within a loop:
"\B\$foo\b"
"\B\$boo\b"
.....
now I want to exclude replacement when reading Smarty ...
0
votes
2answers
31 views
capture all characters between match character (single or repeated) on string
I'm trying to extract the string preceding a specific character (even when character is repeated, like this (ie: underscore '_'):
this_is_my_example_line_0
this_is_my_example_line_1_
...
1
vote
0answers
25 views
Regex in ms word to replace last octet?
I'm using this
([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})(.[0-9]{1,3})
to replace 122.22.12.44
with
122.12.12.11
in replace section i write \1\211
so far its not working it just replaces as
...
0
votes
1answer
55 views
Java Regex Not Matching When it Should
I'm looking to pull out a specific HTML a tag from some HTML that contains a specific date.
The HTML supplied to this in the unit test is:
Here is the Unit Test in question:
public void ...
0
votes
3answers
23 views
Representing carriage returns and quotes with regular expressions in java
I want to replace a carriage return followed by quotation marks with just quotation marks. For example, if I have:
Hello World
"Hello World"
I would like the result to be:
Hello World"Hello ...
1
vote
3answers
22 views
Regular Expression remove [caption]
I am trying to remove some html from my string of text which comes from a Wordpress generated database.
I want this:
Marnie Stanton led us through the process first and then everyone went crazy.
...
4
votes
3answers
39 views
PHP Regex preg_match extraction
Although I have enough knowledge of regex in pseudocode, I'm having trouble to translate what I want to do in php regex perl.
I'm trying to use preg_match to extract part of my expression.
I have the ...