All Questions
Tagged with regular-expression expression
16 questions
4
votes
2
answers
518
views
Capturing all matches (occurences) with QGIS regular expressions
Problem
I use QGIS with the expression function regexp_matches() that returns an array of all strings captured by capturing groups. Regular expressions normally capture only the first match (occurence)...
3
votes
1
answer
355
views
Split a text string with each character as an element of an array with QGIS expressions and regular expressions
I want to use QGIS expressions to split up a text string to an array with each element representing one character of the input's string, like:
input: mytext -> ouput: [ 'm', 'y', 't', 'e', 'x', 't' ...
2
votes
2
answers
347
views
Identify and move data containing special characters to a separate column
My dataset contains special characters. I want to identify the data which contains special characters and separate it into a new column.
List of special characters :
`~!@#$%^&*_{}[]<>?/
...
5
votes
1
answer
278
views
Filtering list of data mixed with both full capital letter words and small letter words in QGIS
My dataset contains mixed values of both capital and small letter wordings, e.g.
Hello world (contains fully small letter wording 'world')
HELLO World (contains fully capital letter wording 'HELLO')
...
1
vote
1
answer
157
views
Replacements QGIS/Excel
I have a field filled with expressions like these: 'Xm1 to Xm2'; 'Xm2 to Xm1'; 'Xm19 to Xm20'
And I also have an imported Excel table with the correspondet text to replace Xm1, Xm2, Xm(n), ..., Xm20.
...
0
votes
1
answer
181
views
QGIS Regex expression label
I'm trying to use regex expression to label my layer in order to show the parcel number.
Here is some examples of what i'm looking for :
From this "53042A0027/00M002", to "A27M/2"
...
3
votes
2
answers
415
views
Replace all but coordinates from a WKT string, including closing bracket ')'
To get a list of coordinates from a polygon and remove unwanted parts from the resulting string, the following expression works fine to remove the string elements 'Polygon', spaces and opening ...
5
votes
2
answers
248
views
QGIS defining the nth character where the label could be wrapped
I have the labels, which include a few of the same characters "/". Unfortunately, I cannot simply use the "Wrap on character" option, because it wraps everywhere where this ...
4
votes
2
answers
1k
views
Regular expressions within QGIS expressions: logical operator AND
Context
I use QGIS expressions and want to use regular expressions to identify those strings that contain two words. It's easy to identify those features of the field text that contain both QGIS or ...
3
votes
1
answer
3k
views
Removing part of string from the right in QGIS
I am trying to remove the last piece of my string in QGIS.
I want to delete the E10 from the end.
I tried both:
How to easily edit attribute data using Regular Expressions?
regexp_replace("UPRN&...
1
vote
2
answers
1k
views
Replacing characters using an expression in QGIS
What regular expression can I use to change values in a string field? I need to change the letter B to a symbol - before the digits, and digits with letter F to make positive.
Like this:
7
votes
3
answers
669
views
Expression to replace characters in QGIS Attribute table
I have a string field. Which requests to put the letter F after the number to all positive digits, and the letter B after minus digits and to delete the sign -.
Finally, I want a result like this:
4
votes
2
answers
391
views
Select characters using regular expression in QGIS
I'm trying to seperate characters from database to seperate fields. Database is like:
999-10-1-1
999-10-11-111
999-10-111-1111
999-10-22-1
999-10-1111-2221
and I want something like in seperate ...
3
votes
1
answer
591
views
How to clean data in attribute table in QGIS 2.18.14?
I have a 'name' field with composite name; numbers and words
e.g. "1237, Café"
I managed extract the part number with Field Calculator and make a new field (see 1) with this expression
left( "...
4
votes
2
answers
360
views
Moving substring from end to beginning of string in QGIS Attribute table
I have a large data set that contains a time range in the format 00:00-00:00 and 1-6 three-day abbreviations of days of the week (MON, TUE, WED, etc.). I managed to get all the time ranges and day ...
7
votes
2
answers
3k
views
Extracting text within parenthesis in a QGIS attribute table
I have a shapefile of data for Japan, and I need to extract the English character names in my "name" field in order to label the layer. Much of the data is all in Japanese, but some of the names have ...