Questions tagged [regular-expressions]
For questions about the function RegularExpression which is used in string patterns in functions as StringCases, StringReplace, StringPosition,StringCount etc.
86
questions
3
votes
3
answers
107
views
Extract doi from a text string
I have a large list with bibliometric information including the doi like this example:
...
1
vote
1
answer
62
views
Difficulty using StringCases to obtain desired substring
I have extracted and stored some plaintext strings (derived from a pdfs) from the web that I wish to search for various values following certain text substrings that are different for different ...
3
votes
2
answers
140
views
Small trouble with variable referencing in StringReplace?
I am trying to do the following:
Take a string abcdEFGpcf and replace whatever is between abcd and ...
2
votes
1
answer
88
views
Is there a function which checks the validity of a string to be used as argument to RegularExpression?
Is there a function which checks the validity of a string to be used as argument to RegularExpression?
Composing regular expressions is not an easy task. In ...
1
vote
0
answers
41
views
A successful StringReplace with an error message [closed]
An example of StringReplace and RegularExpression :
...
6
votes
1
answer
90
views
Split a multi-line string at the beginning of each line using RegularExpression
I want to replicate the following code using RegularExpression instead of StartOfLine:
...
5
votes
2
answers
249
views
StringCases with string replace and with escape characters
I want to extract url address of all css files inside HTML source.
First output is as expected. But why second and third outputs are different? Notice that only "href" was removed from ...
4
votes
2
answers
2k
views
3
votes
3
answers
166
views
Regular Expressions in FileNameJoin[]
I'm attempting to create a list of folders that match a particular pattern.
For example, consider I have the following files in a directory structure:
...
4
votes
1
answer
205
views
How to extract Table data using regular expressions?
For example, the Table have follows structure:
...
0
votes
0
answers
86
views
Why my code give empty plots? AND When I increase the number of mx , mt my code is running for a long time
In my code, two graphs are not displayed. what is the problem?Also when I increase the number of mx and mt, the code enters the running for a long time.
The regularization problem is described as
$D^{...
5
votes
2
answers
240
views
using StringReplace and StringPattern to convert exp(...) to Exp[....]
I am looking at a file generated by another CAS. I'd like to convert it to Mathematica syntax.
Only issue is how to convert exp(....) to ...
0
votes
0
answers
35
views
Correcting Import Errors presumably caused by unwanted whitespace characters
In scrapping data from a website that has a list of references searchable by the first
letter of the author. I have attempted to Import this as a single html file for each
letter. Oddly, this works ...
3
votes
1
answer
85
views
How to do context-sensitive matching with the pattern system?
In Perl RegEx, we have the look-ahead/behind feature; it there a similar functionality available for Wolfram Language patterns?
Re @mikado:
Suppose we have a random expression in ...
1
vote
3
answers
69
views
How can I let StringPosition consolidate overlapping matches?
Consider an example like this one:
StringPosition[" -aa.ef -ag.hi -aa.ei",
RegularExpression["\\s+-(?=a+\\.)"]]
which returns
...