Support this site
Home
Broadband
ISPs
Tech
Routers
Wiki
Forum
Rate your ISP
Glossary
May 11, 2024, 01:44:20 PM
Welcome,
Guest
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Login
Register
Kitz Forum
>
Chat
>
Tech Chat
>
Regex weirdness
« previous
next »
Pages: [
1
]
Print
Author
Topic: Regex weirdness (Read 980 times)
Weaver
Senior Kitizen
Posts: 11459
Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Regex weirdness
«
on:
January 14, 2018, 04:12:10 PM »
I have a regex which works, it matches test data as expected:
[-:;]
ie match hyphen, colon or semicolon. Despite the special meaning of hyphen to indicate ranges, I believe this is ok because the hyphen is at the start. Anyway, it does behave as expected. As a sanity check I looked at it using this superb tool, which I use a lot:
https://regex101.com
So, I later wanted to alter it for a different circumstance to not try and match hyphens:
[:;]
but for some unknown reason this
now does not match
against my input. The tool says it should work against my exact data.
My question:
Is there something wrong about this second form?
Confession: The above isn’t the entire actual regex, the real thing and also its test data are quite long but this shows the only change made to the regex, so I reduced it down for ease of presentation. Explanation as to why this should be fair is as follows.
These alternative forms both
do
work though
[;:]
[\:;]
I am using the
Workflow
interpreted language for iOS. These regexes are in a program that I have written in Workflow.
«
Last Edit: January 14, 2018, 04:40:49 PM by Weaver
»
Logged
Print
Pages: [
1
]
« previous
next »
Kitz Forum
>
Chat
>
Tech Chat
>
Regex weirdness
anything