Regex to match exact word and dash symbol
-
hi would any one have a regex that would match (aug -) or(july -) or (june -)without the brackets but would not match just (aug)or (july) or (june) So far i have \W*((?i)aug -(?-i))\W* but this also matches aug which i dont want thanks
-
hi would any one have a regex that would match (aug -) or(july -) or (june -)without the brackets but would not match just (aug)or (july) or (june) So far i have \W*((?i)aug -(?-i))\W* but this also matches aug which i dont want thanks
I tried your regex in Expresso, and it matches "hello aug -goodbye" but not "hello aug goodbye". So ... what are you talking about?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
I tried your regex in Expresso, and it matches "hello aug -goodbye" but not "hello aug goodbye". So ... what are you talking about?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
im using regex in placemint for placement of window and brousers if i title a folder aug placemint macthes it , but i only want match on aug -
-
hi would any one have a regex that would match (aug -) or(july -) or (june -)without the brackets but would not match just (aug)or (july) or (june) So far i have \W*((?i)aug -(?-i))\W* but this also matches aug which i dont want thanks
Im no ideas what should be captured, so Im guessing that it should include alternates like... \W*(?i)((?:aug|july|june)(?-i) -)\W* Except that both \W* are redundant since they allow 0-occurrences, so they dont alter any matched text. Its best to include samples to keep the experts from guessing, so I will try to save them some troubles... Capture 'aug' or 'July' or 'JUNE' as whole words if followed by: 1-space, 1-hyphen, 0-or-1 space, and a 1-or-2 digit word. .*\W(?i)(aug|july|june(?-i)) - ?\d{1,2}\W.* Capture 'aug -' or 'July -' or 'JUNE -' with the same conditions... .*\W(?i)((?:aug|july|june(?-i)) -) ?\d{1,2}\W.* Capture 'aug -##' or 'July - ##' or 'JUNE - ##' with the same conditions... .*\W(?i)((?:aug|july|june(?-i)) - ?\d{1,2})\W.* Capture 'aug -' or 'July -' or 'JUNE -' as whole words, but only if - is followed by a non-word character like %. This does seem the most unlikely, but Im trying to copy your original match, because no samples are being posted... .*\W(?i)((?:aug|july|june)(?-i) -)\W.* If none of these match properly, you should include samples of your text lines, and say what should be captured. There is many experts who is not even going to answer, without first seeing some samples.
-
Im no ideas what should be captured, so Im guessing that it should include alternates like... \W*(?i)((?:aug|july|june)(?-i) -)\W* Except that both \W* are redundant since they allow 0-occurrences, so they dont alter any matched text. Its best to include samples to keep the experts from guessing, so I will try to save them some troubles... Capture 'aug' or 'July' or 'JUNE' as whole words if followed by: 1-space, 1-hyphen, 0-or-1 space, and a 1-or-2 digit word. .*\W(?i)(aug|july|june(?-i)) - ?\d{1,2}\W.* Capture 'aug -' or 'July -' or 'JUNE -' with the same conditions... .*\W(?i)((?:aug|july|june(?-i)) -) ?\d{1,2}\W.* Capture 'aug -##' or 'July - ##' or 'JUNE - ##' with the same conditions... .*\W(?i)((?:aug|july|june(?-i)) - ?\d{1,2})\W.* Capture 'aug -' or 'July -' or 'JUNE -' as whole words, but only if - is followed by a non-word character like %. This does seem the most unlikely, but Im trying to copy your original match, because no samples are being posted... .*\W(?i)((?:aug|july|june)(?-i) -)\W.* If none of these match properly, you should include samples of your text lines, and say what should be captured. There is many experts who is not even going to answer, without first seeing some samples.
Thanks for trying to help me with this, im a complete novice with regex i am trying to capture 'aug -' or 'July -' or 'JUNE -' sentance 'the aug' = would not match sentance 'aug1' = would not match sentance 'aug -2' = would not match sentance 'aug -' = would match
-
Thanks for trying to help me with this, im a complete novice with regex i am trying to capture 'aug -' or 'July -' or 'JUNE -' sentance 'the aug' = would not match sentance 'aug1' = would not match sentance 'aug -2' = would not match sentance 'aug -' = would match
-
Im guessing that you posted 4 complete samples, and that 'sentance' means 1 whole line?... \b(?i)((?:aug|july|june)(?-i) -)$
yes thanks sentance means 1 whole line, i tried \b(?i)((?:aug|july|june)(?-i) -)$ but its not matching anything
-
yes thanks sentance means 1 whole line, i tried \b(?i)((?:aug|july|june)(?-i) -)$ but its not matching anything
-
Its a PCRE regex to capture text just like your 4th-sample, so matching any lines that end like... aug - Maybe you're using something else?? Not using $1 or \1 for replace?? Not giving full samples??
example i use \W*((?i)ALARM CLOCK(?-i))\W* so any window that says alarm clock is placed at same position on desktop
-
example i use \W*((?i)ALARM CLOCK(?-i))\W* so any window that says alarm clock is placed at same position on desktop
Without full samples relating to your posted question, Im really afraid nobody is going to help you. This site shows how my regex matches what you said needs to matched. https://regex101.com/r/cH4Jrg/1 Feel free to experiment with it, if that's easier than trying to describe what should be matched.