Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Browse by Tags

All Tags » pcre
Showing page 1 of 3 (22 total posts)
  • need advice

    Here is a problem I have been banging my head at for a couple of days.I was wondering if anyone could help. I have this class of strings with this pattern: s1?=s2? s3 s4?          = always follows s1 only, and only if s1 is not empty s1 is  ({?\(?word( word)*\)?\}?)?  (it may be empty). If there is more that one ...
    Posted to Construction Advice (Forum) by danb on July 11, 2012
  • why doesn't this fail?

    I am using PCRE (same with .Net) and I would have expected the following pattern to fail when i run it against the text below: (?<B><)?[^%>]+(?(B)>)% that is: look for a < , look for at least 1 char which is not % or > then, if a < was found look for a >, then look for a % in other words find expressions like ....% ...
    Posted to Discussion (Forum) by danb on January 9, 2012
  • Re: looking for shortest pattern in "start...[start...end]"

    First of all thank you for taking the time to look into this. Second, apologies for not providing more engine details. I should have known better. I am using PCRE as you guessed and I am indeed looking for the underlined part in  aaap1bbbp1cccp2ddd (I need p1 and p2 separated but that's easy). I tried  your pattern on a simple ...
    Posted to Construction Advice (Forum) by danb on December 12, 2011
  • DOB RegEx for an Encryption Dictionary

    Hello all, my first time posting, but I use the site often as a resource, really wonderful. First, I want to say that I realize that RegEx is not the best choice for what I need to accomplish, however, the Encryption Engine my company wrote is homegrown and only permits standard Word Lists and RegExs (. So I am using RegEx, for good or for bad. ...
    Posted to Construction Advice (Forum) by Keith Harrison on March 29, 2011
  • multiple negative lookaheads in PCRE?

    I'm writing search filters using regex (PCRE flavored). My filter is this:  ((?i)((\s(529|53[01247]))\s+security).+user\sname:(?!.{1,20}(\$|caller))(?!\sdomain)) The data looks something like this: 1 <13>Mar 22 09:11:16 10.0.1.7 MSWinEventLog 0 Security 3553368 Tue Mar 22 13:11:16 2011 537 Security SYSTEM User Failure Audit ...
    Posted to Construction Advice (Forum) by twnet on March 29, 2011
  • Remove / Replace characters between specific points in a file name

    I'm attempting to use PCRE as part of my scripting and have hit a mental block. Regex is not a strong point for me so please bear with me. What I have is a file name such as this one: My music name (Album Name - Artist Name) 2010_12_15_14_45_55 0001.mp3 What I want to do is remove the date/time/unique number from the name which was ...
    Posted to Construction Advice (Forum) by gritts on January 16, 2011
  • replace pattern between anchor tags

    Platform: PCRE Purpose:  am trying to teach myself a little PCRE.  In particular an expression has been nagging me: <?php $text="this-that <a href=\"http://www.my-site.com/index.php\">this-that</a> ...
    Posted to Construction Advice (Forum) by james438 on March 9, 2010
  • Re: Matching Unicode

    According to the documentation the 'u' modifer is for UTF8 not Unicode. It treats the sring as UTF8. Doc: u (PCRE_UTF8) This modifier turns on additional functionality of PCRE that is incompatible with Perl. Pattern strings are treated as UTF-8. This modifier is available from PHP 4.1.0 or greater on Unix and from PHP 4.2.3 on win32. ...
    Posted to Construction Advice (Forum) by sen5241b on January 13, 2009
  • Validating Email Revisited

    First off let me say I'm a bit over my head here. Not regex part but host the language of the regex engine. Many moons ago I posted a blog article stating why you could not write a regex that validated an e-mail address 100%. Well this is still true, however in that posted I also stated that the pattern was so massive ...
    Posted to Michael Ash's Regex Blog (Weblog) by mash on September 28, 2008
  • Re: Regex for unknown number of lines - Assistance Request

    It's OK, I think I've found the answer to my own question. The # signs bracket the actual regular expression, and the e and the s are modifiers - e is equivalent to PREG_REPLACE_EVAL and  s is equivalent to PCRE_DOTALL. Maybe these are things which are so familiar to the experienced players that they almost go without saying, but ...
    Posted to Construction Advice (Forum) by mtgradwell on June 8, 2008
1 2 3 Next >