regex101 | cross platform | Regex library
kandi X-RAY | regex101 Summary
kandi X-RAY | regex101 Summary
This project is a desktop version of the regex101.com site. It embeds a copy of the site inside the application so that no internet connection is required to work on regular expressions. The motivation behind this was that when developing regular expressions for use in products, I often find myself opening the website again and again, resulting in many tabs in various states swamped in the sea of web pages.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of regex101
regex101 Key Features
regex101 Examples and Code Snippets
Community Discussions
Trending Discussions on regex101
QUESTION
We have thousands of structured filenames stored in our database, and unfortunately many hundreds have been manually altered to names that do not follow our naming convention. Using regex, I'm trying to match the correct file names in order to identify all the misnamed ones. The files are all relative to a meeting agenda, and use the date, meeting type, Agenda Item#, and description in the name.
Our naming convention is yyyymmdd_aa[_bbb]_ccccc.pdf
where:
- yyyymmdd is a date (and may optionally use underscores such as yyyy_mm_dd)
- aa is a 2-3 character Meeting Type code
- bbb is an optional Agenda Item
- ccccc is a freeform variable length description of the file (alphanumeric only)
Example filenames:
...ANSWER
Answered 2021-Jun-15 at 17:46The optional identifier ?
is for the last thing, either a characters or group. So the expression ([a-z0-9]{1,3})_?
makes the underscore optional, but not the preceding group. The solution is to move the underscore into the parenthesis.
QUESTION
I am practicing regular expressions in Kotlin and trying to start with a simple string. However, I am not receiving any matches. I feel like I am doing it right and can't figure out the problem.
Test String:
VERSION_ID="12.2"
And what would I do this for multiple lines:
...ANSWER
Answered 2021-Jun-15 at 04:10The version ID value inside your string appears to be surrounded with double quotes. Also, I suggest making the decimal portion optional, in case some versions might not have a minor version component:
QUESTION
I am trying to clean a column:
...ANSWER
Answered 2021-Jun-14 at 04:29I tried this regex, it worked.
QUESTION
I'm trying to capture the show name, episode number, episode title, and resolution if present. Standard def episodes in my collection don't have a resolution suffix.
For the given samples:
...ANSWER
Answered 2021-Jun-13 at 16:21You can use
QUESTION
I'm looking for help in making a regex to match and not match a series of name patterns if anyone can help with that.
Here's a list of cases I want to match/ not match :
...ANSWER
Answered 2021-Jun-11 at 11:16I think you're looking for something like this:
QUESTION
I have a long xml text and I want to match each product that is available. The text is made of products that are structured like this:
...ANSWER
Answered 2021-Jun-10 at 20:39Use an XML parser. If there is none you can use use
QUESTION
This is my regex: https://regex101.com/r/fBq3Es/1
(audiência|sessão virtual)(?:.(?!audiência|sessão virtual|até))*([1-2][0-9]|3[0-1]|0?[1-9])\s*de\s*([^\s]+)\s*de\s*((19|20)?\d\d)(?:,|\s*)*(?:,|\s*)*(?:\S*)?(?:,|\s*)*([01]?[0-9]|2[0-3])(h|:|\s*horas*\s*e\s*|\s*horas*\s*)([0-5]?[0-9])?
It should pick something like this:
Lorem Ipsum Lorem Ipsum Lorem Ipsum Audiência em 24 de Julho de 2022 às 16:00 horas Lorem Ipsum Lorem Ipsum Lorem Ipsum
And extract the "24 de Julho de 2022 às 16:00 horas"
its taking only the "4 de Julho de 2022 às 16:00 horas"
missing the first digit for some reason.
The problem is, "9 de Janeiro de 2021"
(with no leading zeroes or any other numbers) is also a possible input and answer.
I asked this question a few days ago and got the answer that the logic for the date bit of my regex is working (but only when taken out of the larger expression) "([1-2][0-9]|3[0-1]|0?[1-9])
", I've tried changing positions, different combinations, to make the zero fixed and add another or ([1-2][0-9]|3[0-1]|0[1-9]|[1-9])
, none of them worked.
So why does it "Eat" the first day digit, when its inside the full expression?
A demo of it is running as said on regex101.com with the config set to ECMAScript (JavaScript) and global multiline and case insensitive.
As they questioned me where this is being used, this bit regex was taken from a workflow that has a text parser "Module" that accept regex with those configurations, I can only feed it a regex, no different programing languages allowed.
...ANSWER
Answered 2021-Jun-09 at 20:40You can add a space:
QUESTION
I'm trying to write out a regex that checks that the following has been written:
...ANSWER
Answered 2021-Jun-09 at 18:25If we want to create a regular expression that matches a string comprised of the substrings
Doe Ray Me Far Sew La Tea
in any order, and we don't want to tediously create a very long expression including every possible ordering, we may begin by trying
(Doe|Ray|Me|Far|Sew|La|Tea){7}
which matches a string containing the seven substrings in any order.
We then have the problem that the expression does not fail to match if one or more substrings is repeated or missing.
One way to ensure each substring appears only once is to add a negative lookahead to each alternative to ensure it doesn't appear in the string again ahead of the match.
(Doe(?!.*D)|Ray(?!.*R)|Me(?!.*M)|Far(?!.*F)|Sew(?!.*S)|La(?!.*L)|Tea(?!.*T)){7}
Note that only the first letter of the substring is required in the lookahead because the first letter of each substring is different.
In your particular case, the following seems to work fine although it hasn't been thoroughly tested.
The final trailing comma is made optional by (,|(?=\s*\}))
, which ensures that if there isn't a comma then there must be a '}'
ahead in the string after optional whitespace.
You may not want to make the semicolon optional as done here.
You may also want to split a long regular expression into multiple lines.
QUESTION
I wrote regular expression
...ANSWER
Answered 2021-Jun-09 at 17:02You're just calling .next()
once, so you only get the first match.
You need to loop over all the results of .matchAll()
.
QUESTION
I have a block of html code in a file. I have a class that I'm using called highlight-address to locate the text in a very large html file. I'm looking for all text in between the >City, St zip< It finds all 4 occurrences in the file but for some reason I'm not sure why it returns only 2 of the desired values. It seems to ignore the desired regex and moves to something past it.
REGEX: highlight-address[\S\s]?>(.)
...ANSWER
Answered 2021-Jun-09 at 11:49It might be a better option to use BeautifulSoup, and afterwards remove the newlines preceded by an optional equals sign.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install regex101
Windows. The application is supplied as an installer executable, download and run the installer to install the application, this will create a shortcut which can be used to launch the software.
macOS. The application is supplied as a dmg disk image. Download and open the disk image and drag the Regular Expressions 101 icon into the Applications folder, the application can then be launched by double clicking on the Regular Expressions 101 icon in Applications.
Linux. The application is supplied as an AppImage. Download the application and then from the terminal run the command: chmod +x <downloaded filename>
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page