User Tools

Site Tools


regex:all_text_not_containing

This is an old revision of the document!


Regex - All Text Not Containing

Text that does not contain ~

[^~\x22]+

Match anything except \n

.*

Match strings that do not start with a sequence

Ignore strings that start with the label “abc_”.

Use a negative look-ahead assertion:

^(?!abc_).+

Or, use a negative look-behind assertion:

(^.{1,3}$|^.{4}(?<!abc_).*)

Or, use plain old character sets and alternations:

^([^a]|a($|[^b]|b($|[^c]|c($|[^_])))).*

Matching if not ending in particular sequence

Use a negative lookbehind assertion:

^[/\w\.-]+(?<!\.html)$

or, use a lookahead:

^(?!.*\.html$)[/\w\.-]+$

References

regex/all_text_not_containing.1748332143.txt.gz · Last modified: 2025/05/27 07:49 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki