Skip to main content
19 events
when toggle format what by license comment
Oct 17, 2022 at 19:54 history edited Peter Mortensen CC BY-SA 4.0
Fixed the weird syntax highlighting (as a result, the diff looks more extensive than it really is - use view "Side-by-side Markdown" to compare).
Feb 15, 2022 at 14:58 history edited questionto42 CC BY-SA 4.0
format since the dot afterwards is regex as well and this is just cleaner to look at
Apr 9, 2020 at 18:00 history edited the Tin Man CC BY-SA 4.0
edited for readability
Aug 30, 2018 at 7:44 comment added Sandburg + doesn't work on some grep implementations. The lexicon is limited, be carefull.
Sep 11, 2015 at 14:33 comment added unknown6656 what about characters like "öäüßÿ...." --> Characters in other languages, which have accents etc.?
May 29, 2015 at 18:07 comment added jlaverde @heisenberg YES. x100. I took formal languages a few years ago and this brought it all back.
Sep 8, 2014 at 15:34 comment added SomeRandomDeveloper Upvote for actually breaking down and explaining the pattern! Well done!
Feb 9, 2014 at 21:22 comment added JohnMerlino I like how you broke down the regular expressions too
Oct 5, 2013 at 17:45 comment added doug65536 What's going on with all the up-votes. This is not correct. It only works for English. If you are going to make an edit, EDIT it. Don't add on an "Edit:", just make it correct.
Feb 20, 2013 at 14:37 comment added Charlie It looks like preg_match requires your pattern to be enclosed with delimiters, which are normally slashes. So you would need "/^[a-zA-Z0-9_]*$/". See this question for more info: stackoverflow.com/questions/6445133/…. See also this page: forums.phpfreaks.com/topic/…
Feb 19, 2013 at 5:14 comment added Chris Harrison I get "No ending delimiter '^' found", when I use this pattern with preg_match
Jul 31, 2012 at 19:50 comment added Induster I've seen this in many places, but it still allows the '$' character for me. All other special characters are blocked that I've tested so far.
Jun 10, 2012 at 5:09 comment added tchrist [\p{upper}\p{lower}\p{gc=Number}_] is all you need to do this right, presuming there are no combining characters.
Oct 24, 2011 at 22:24 comment added Hakanai The original question did say "upper and lowercase letters", so it would seem that "letters" from non-Latin scripts should match.
Dec 3, 2008 at 16:19 history edited Charlie CC BY-SA 2.5
updated notes about \w
Dec 3, 2008 at 7:45 comment added Jan Goyvaerts \w and [A-Za-z0-9_] are not equivalent in most regex flavors. \w includes letters with diacritics, letters from other scripts, etc.
Dec 3, 2008 at 6:42 comment added Windows programmer If you ever go to Germany or if you ever see just about any German text you'll see what I'm saying.
Dec 3, 2008 at 5:12 history edited Charlie CC BY-SA 2.5
added note about \w
Dec 3, 2008 at 4:33 history answered Charlie CC BY-SA 2.5