I have a set of strings with numbers embedded in them. They look something like /cal/long/3/4/145:999 or /pa/metrics/CosmicRay/24:4:bgp:EnergyKurtosis. I'd like to have an expression parser that is
|
I'm using the Java matcher to try and match the following:
@tag TYPE_WITH_POSSIBLE_SUBTYPE -PARNAME1=PARVALUE1 -PARNAME2=PARVALUE2: MESSAGE
The TYPE_WITH_POSSIBLE_SUBTYPE consists of letters with periods.
Every parameter has to consist of letters, and every value has ... |
I'm trying to build a bbcode parser, but I'm having quite some problems figuring out how to avoid matching too widely. For example I want to implement a [list] to ... |
For example, given the string "2009/11/12" I want to get the regex ("\d{2}/d{2}/d{4}"), so I'll be able to match "2001/01/02" too.
Is there something that does that? Something similar? Any idea' as ... |
Can anyone give me a hand with a touch of regex?
I'm reading in a list of "locations" for a simple text adventure (those so popular back in the day). However, I'm ... |
How should I parse the following String using Java to extract the file path?
? stands for any number of random charaters
_ stands for any number of white spaces (no new line)
?[LoadFile]_file_=_"foo/bar/baz.xml"?
Example:
10:52:21.212 ...
|
I need to parse a search query with a "Google-like" syntax (but simpler, since I don't need parenthesis, operator nesting and such). An example string might be:
TAG1: a,b,c TAG2: 123 TAG3: ... |
|
This is specifically aimed at parsing hex bytes, but there's a more general question here.
Suppose I have a regexp r e.g. \\s*([0-9A-Fa-f]{2})\\s* (optional spaces, 2 hex digits that I'm interested in, ... |
I have a following string that I would like to parse into either a List or a String[].
(Test)(Testing (Value))
End result should be Test and Testing (Value)
|
How would you parse the values in a string, such as the one below?
12:40:11 8 5 ...
|
I'm in a situation where I need to parse arguments from a string in the same way that they would be parsed if provided on the command-line to a Java/Clojure application.
For ... |
I have this sample string:
Sample string 1:
A^1.1#B^1#I^2#f^0#p^1#d^2010-07-21T08:52:05.222ZKHBDGSLKHFBDSLKFGNIF#%$%^$#^$XLGCREWIGMEWCERG
Sample string 2:
A^1.1#B^1#f^0#p^1#d^2010-07-22T07:02:05.370ZREGHCOIMIYR$#^$#^$#^EWMGCOINNNNNNVVVRFGGYVJ667VTG
So, from these strings, I need to take out the time stamp:
2010-07-21T08:52:05.222 or
2010-07-22T07:02:05.370
Basically values b/w d^ and Z
What is the best ("smartest") way ... |
I have a string that looks like "A=1.23;B=2.345;C=3.567"
I am only interested in "C=3.567"
what i have so far is:
Matcher m = Pattern.compile("C=\\d+.\\d+").matcher("A=1.23;B=2.345;C=3.567");
while(m.find()){
...
|
This is a generalization of a specific problem I am trying to solve.
Given a string of uniquely identifiable elements separated by a single space:
0 1 2 3 4
Without modifying the string, ... |
I just joined StackOverflow after having found many great answers here in the past. Here's my first question:
EDIT: I feel bad... my first question to StackOverflow turned out to be a ... |
In Java, I'm attempting to parse data from an ASCII output file. A sample of the data looks is show below. The values are formatted precision 5 scale 3 and no ... |
I am trying to parse some word documents in java. Some of the values are things like a date range and instead of showing up like Startdate - endDate I am ... |
I have some data that looks like this
myobject{keyone:"valueone",keytwo:"valuetwo",keythree:"valuethree"}
myobject{keyone:"valueone",keytwo:"valuetwo",keythree:"valuethree"}
myobject{keyone:"valueone",keytwo:"valuetwo",keythree:"valuethree"}
And I'm wondering what the best way to create a bunch of objects from it would be. I've written the following regex to extract ... |
I have a string like:
"GOOG",625.00,"-1.95 - -0.31%"
I'm using this pattern, and it isn't matching. I'm trying to get GOOG. What am I doing wrong?
Pattern pattern = Pattern.compile("^\"([^\"]+)");
Matcher matcher ...
|
I have a string:
hello example >> hai man
How can I extract the "hai man" using Java regex or another technique?
|
I have a string of the form AU 12345T or AU 12345T1; basically it is of the form alphabet characters(s) followed by a number then ending in a one or two ... |
This is a question both specific to the parboiled parser framework, and to BNF/PEG in general.
Let's say I have the fairly simple regular expression
^\\s*([A-Za-z_][A-Za-z_0-9]*)\\s*=\\s*(\\S+)\\s*$
which represents the pseudo-EBNF of
<line> ...
|
In java, I'm trying to process functions of the from FUNC{parameter,parameter} using regular
expressions.
I've isolated the string containing the parameters, and now I have to extract them from the string. My ... |
What would be a RegExp equivalent of substring from position x to position y?
For example:
0001..STACK.OVERFLOW...IS.AWESOME.13052011
I know that the value of a field called 'status' in this fixed length string is ... |
I would like to know how to parse the last 6 digits from a Java string. So:
String input1 = "b400" // the regex should return b400
String input2 = "101010" ...
|
Given a wikiText string such as:
{{ValueDescription
|key=highway
|value=secondary
|image=Image:Meyenburg-L134.jpg
|description=A highway linking large towns.
|onNode=no
...
|
I have a string of
"name"=>"3B Ae", "note"=>"Test fddd \"33 Ae\" FIXME", "is_on"=>"keke, baba"
and i want to parse it by a java program into segments of
name
3B Ae
note
Test fddd \"33 Ae\" FIXME
is_on
keke, ...
|
I need a regex for parsing key-value-pairs from a properties-file to write them into a database. The application is written in java. As I need to store information about comment-lines and ... |
I have an extremely long string that I want to parse for a numeric value that occurs after the substring "ISBN". However, this grouping of 13 digits can be arranged differently ... |
I cannot seem to grasp the whole concept of regular expressions, I've been working with php for a couple years now and have, for the most part, tried to avoid the ... |
This is my Regex
((?:(?:'[^']*')|[^;])*)[;]
It tokenizes a string on semicolons. For example,
Hello world; I am having a problem; using regex;
Result is three strings
Hello world
I am having a problem
using regex
But when I use ... |
I have this string:
"{ '_id' : ObjectId('4e85ba250364e5a1857ba2e4'),
'message' : '<user=animesh@strumsoft.com>, <action=create-flock>,
params=[<title=[smile.animesh@gmail.com, ram@strumsoft.com],
attendees=immediate, flockType=immediate, duration=30]>' ...
|
I'm working on parsing an address string and have found that sometimes the street name contains a word that is also a valid city name. I want to be sure ... |
Let me begin by stating that this is a question of aesthetics. I've solved my own problem, I'm just curious about better ways of doing it.
So, I've got a certificate ... |
I am trying to make a simple calculator application that would take a string like this
5 + 4 + 3 - 2 - 10 + 15
I need Java to parse this ... |
I was wondering how to implement the following problem: Say I have a 'set' of Strings and I wish to know which one is the most related to a given value.
Example: ... |
As input parameters I can have two types of String:
codeName=SomeCodeName&codeValue=SomeCodeValue
or
codeName=SomeCodeName
without codeValue.
codeName and codeValue are the keys.
How can I use regular expression to return the key's values? In this ... |
Im making a program visualization and im using gdb as an interpreter. The variables inside the forloop statment will be used in 'display variable_name' command so that I can track values ... |
A while back I posted a problem with recursive syntax and regex. I couldn't do what I really wanted so I'm doing what feels like a bit of a hack. I got regex to find the innermost macro call in a nested expression. In a loop I replace the innermost with the results of the macro call and search again. Next ... |
Hi, I want to construct a regular expression to divide the string (abc.3, d.42), (cde.2, 3) into 2 groups: 1. abc.3, d.42 2. cde.2, 3 I tried the following regular expression \\([.*]\\) in String.split(), but it returns an empty array. Please help me to see what is wrong with my regular expression. Thanks! Greg |
Write a program in Java that can parse a mathematical expression String, calculate the expression, and produce a numeric result. For example, given the string: "2.5+3*4+6/12-7" produce the result 8.0 Requirements: Parser * expression can contain Integers or floating-point numbers * expression can contain Operators for addition, subtraction, division and multiplication * parser should throw an Exception when the expression is ... |
This thread is much more confusing than it needs to be. Dash's pseudocode implies that he's matching the regex "aaaaa" against the target string "a*", which is backward. Then we learn from the the quoted text in Marilyn's reply (quoted from where, I wonder? - edit: never mind, it came from here) that the regex is really "a?", which is good, ... |
http://www.csc.liv.ac.uk/teaching/modules/year3s1/comp304.html i need to parse this page and extract the member of staff on this page using regular expression. Using java.utility.regex i only need the regular expression rest code i have done ////// import java.io.*; import java.net.*; import java.util.regex.*; class Spider{ public static void main(String []argv){ try { URL url = new URL("http://www.csc.liv.ac.uk/teaching/modules/year3s1/comp304.html"); URLConnection urlConnection = url.openConnection(); DataInputStream dis = new ... |
Hi All, I need to parse a formula which can have comments. A valid formula will be something like this. B = rescale(A,'monthly') +33 ; 'this is a comment The formula should end with semicolon ";" and a comments can start with single quote('). If a formula does not end with semi colon then i should throw an Exception (Syntax error) ... |
|
Ohh I see, well thanks for that. So I guess it isn't allowed unless I show the map too. But I don't think they'd find out :S. All i'm doing is downloading their page to my hard drive, its like opening a web browser. Once the page is on my hard drive, I'm just doing myself the pleasure of showing myself ... |
(My first instinct says to simply add " s" in the regex since that will match a newline as well as whitespace, or just ".*" to match any character, but since I'm reading it in with a while loop, I don't know if that applies, so here's the code I have reading from the URL:) |
I agree on the CSS parser idea and very observant readers might have noticed that my test class is called CSSParserTwo. CSSParserOne was my first try using the css parser from http://cssparser.sourceforge.net/ and the interface library from http://www.w3.org/Style/CSS/SAC/. Unfortunately this idea didn't work so well. First the parser believes that I should be interested in the layout stuff and removes the ... |
|
|
Hi everyone, i need help with regular expressions and String parsing. There is a String command with a command to execute. This String must be checked if there are substrings like: $[[attribute], ''label] where "label" can be any possible string. If there is substring like that then JDialog should be created with JLabel with value from "label" (or any else) and ... |
i dunno about pumping lemmas...that article hurt my brain. but, it looks very much like the problem you have to solve when you are dealing with parathesis in an inline algebraic equation. you use stacks (at least two) to find out if they are balanced by pushing when you encounter the left and popping when you encounter the right. if you ... |